-
-
Notifications
You must be signed in to change notification settings - Fork 665
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
[LUA] Fix do while loops on lua #11807
Conversation
why did it need to have first vsriable anyway |
A test would be good! |
It looks like you just changed the order of the elements in the "or" clause:
to
What's the reason why the order matters? |
Because if the loop expression depends on something to be changed in the loop it breaks. |
Basically it doesn't need to run the conditional expression, thus if the expression has code that depends on one iteration of the loop to run then it wont crash. Do while loops in other languages only runs the conditional expression after the loop has run once, and if it returns true it goes back to the beginning. Replicating this behavior on lua means the |
This seems like it might be unspecified behavior. I think a test would be a good idea to make sure the other targets have the same behavior. If all targets work the same I think it's a good change. |
are there any guides on making a test? |
You can copy some issue test from https://github.com/HaxeFoundation/haxe/tree/development/tests/unit/src/unit/issues, it should be somewhat straightforward from there. |
There tests working! |
I tested it without the fix and only lua crashed, so this seems to work for every other platform thats currently in actions! So thats good! |
This fixes an issue where
would crash