-
Notifications
You must be signed in to change notification settings - Fork 105
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
Stack underflow in generator function #717
Comments
Parse error, most likely, and probably not super difficult to fix, but I'm curious: what is the expected result of It's my understanding that even when |
I'm curious as well :P it's a reduced test case from a web app. |
Really? Node, Deno and Bun all work for me. I guess because we are not calling |
Yes. It's not an early parse error, just a nonsensical construct, AFAICT. |
BTW, I figured out the cause (unfortunate intermingling of yield + if_false vs. nip_catch), just need to think of an elegant way to fix it. js_parse_assign_expr2 emits the yield + if_false, and calls emit_return (emits the nip_catch) in between. |
Context: I was trying to load bluesky with my browser, and QJS output a stack underflow. I bisected the JS, and found the offending code segment (inside a generator function): if (null != l && l.pages)
for (var c of null == l ? void 0 : l.pages)
for (var d of (c.list.creator.did === t && (yield c.list.creator), c.items))
d.subject.did === t && (yield d.subject) which I believe maps to this. function* a() {
for (var x of (yield {}, []))
;
}
var z = a();
z.next();
z.next(); |
FWIW, bellard/quickjs exhibits the same behavior.
The text was updated successfully, but these errors were encountered: