-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix #8821 #15809
fix #8821 #15809
Conversation
I read the original issue, but it wasn't very clear - why do "extreme" ranges cause JS memory issues? |
It just causes compilation program crash when compiling Nim to JS. Because it generates too many labels for JS program. It's hard for me to optimize range branches. We should set a limitation in case that compilation program(NIm JS) crash. |
Your reason to choose |
It's a temporary solution and the issue is still open(The right solution is to change |
I did backport it, because based on the PR title I thought it is a simple non-breaking fix. I can revert the backport if necessary. |
Though this is not a proper fix. But I think it doesn't cause terrible issues. If users complain this, then we could revert this change or increase or decrease threshold. Anyway it prevents compilation program from crashing when compiling to JS. |
Added a limitation for total length of range.
Choose 65535 because it generates 1 MB JS file for simple program