-
Notifications
You must be signed in to change notification settings - Fork 174
Breaks and labels interact incorrectly #741
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
Labels
bug
Something isn't working
Comments
Hah, it's even worse - the var i = 0; while (i < 3) label: {
if (i > 0) break
i++
} Fix incoming! |
bnoordhuis
added a commit
to bnoordhuis/quickjs
that referenced
this issue
Dec 4, 2024
In this snippet... for (;;) label: break ...the break statement jumped back to the start of the loop instead of *out* of the loop. Fixes: quickjs-ng#741
bnoordhuis
added a commit
to bnoordhuis/quickjs
that referenced
this issue
Dec 4, 2024
In this snippet... for (;;) label: break ...the break statement jumped back to the start of the loop instead of *out* of the loop. Fixes: quickjs-ng#741
For posterity: the fix also fixes bellard/quickjs#282 |
Ha, nice one! |
3 tasks
bluesky950520
pushed a commit
to bluesky950520/quickjs
that referenced
this issue
Mar 14, 2025
In this snippet... for (;;) label: break ...the break statement jumped back to the start of the loop instead of *out* of the loop. Fixes: quickjs-ng/quickjs#741
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is essentially me duplicating bellard/quickjs#275 here, since it seems to still affect quickjs-ng:
prints
When the expected output does not print
2
or3
.In particular, this seems to be an issue when using quickjs with code created the js_of_ocaml Ocaml->JS compiler, as this has moved to heavy use of labels and break statements for ocsigen/js_of_ocaml#1496
The text was updated successfully, but these errors were encountered: