Skip to content

stack underflow with generator #488

Closed
quickjs-ng/quickjs
#1396

Description

@gggin
function* x() {
    for (var e of yield []);
}

var g = x();
g.next();      
g.return("test"); 

The root cause of this issue is that yield is being incorrectly identified as being inside a for...of statement, but in reality, the yield hasn't actually entered the for...of loop yet. As a result, an incorrect nip_catch was generated. Could you help look into fixing this?

Activity

  1. bellard commented on Mar 21, 2026

    @bellard
    Owner

    Fixed

  2. added 2 commits that reference this issue on May 13, 2026
  3. added 2 commits that reference this issue on Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions