-
Notifications
You must be signed in to change notification settings - Fork 53
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
[BUG] Upvalues aren't closed correctly after continue
and break
statements
#608
Comments
Thanks for this! Hmmm would be interesting to see an example script where this is causing issues - also what issues are you getting on windows? |
Sorry, I didn't provide any examples, here are some: var f;
for(var i = 1; i <= 3; i += 1)
{
var j = 4;
def g() { print(i + j); }
f = g;
continue;
}
f(); var f;
while(f == null)
{
var i = "i";
def g() { print(i); }
f = g;
continue;
}
f(); With var f;
while(true)
{
var i = "i";
def g() { print(i); }
f = g;
break;
}
f(); As for the compile issues, right now with the current last commit I only get uninitialized errors in some files in the datatypes folder (
Edit: also many linker undefined reference errors to various functions ( |
Ahhh very good find, thank you for providing the issue and the reproduction steps!! I'm more than happy to create the PR but if you want to get your name on the commits and into the repo open up that PR (even if it's just via the web portal and we can go from there!) - just let me know |
I'll try to open a pull request with the fix. |
Is there an existing issue for this?
Current Behavior
Currently, it seems that
continue
andbreak
statements are broken when inside of a loop body there is a closure. This is because currently both statements when closing all locals don't check if the current local popped is an upvalue.This piece of code is present in both
continueStatement
andbreakStatement
functions.I'd just open a pull request, but I'm sadly I'm unable to correctly compile Dictu under Windows with MinGW because of some weird compiler error, so I'll just provide the fix here:
Expected Behavior
No response
Steps To Reproduce
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: