Skip to content

Fix crashers in do/while and while(await(..)) #50

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

Merged
merged 1 commit into from
Nov 22, 2013

Conversation

retronym
Copy link
Member

The new tree shapes handled for do/while look like:

// type checked
async({
  val b = false;
  doWhile$1(){
    await(());
    if (b)
      doWhile$1()
    else
      ()
  };
  ()
})

We had to change ExprBuilder to create states for the if/else
that concludes the doWhile body, and also loosen the assertion
that the label jump must be the last thing we see.

We also have to look for more than just containsAwait when
deciding whether an If needs to be transformed into states;
it might also contain a jump to the enclosing label that is on
the other side of an await, and hence needs to be a state
transition instead.

Fixes #49

The new tree shapes handled for do/while look like:

    // type checked
    async({
      val b = false;
      doWhile$1(){
        await(());
        if (b)
          doWhile$1()
        else
          ()
      };
      ()
    })

We had to change ExprBuilder to create states for the if/else
that concludes the doWhile body, and also loosen the assertion
that the label jump must be the last thing we see.

We also have to look for more than just `containsAwait` when
deciding whether an `If` needs to be transformed into states;
it might also contain a jump to the enclosing label that is on
the other side of an `await`, and hence needs to be a state
transition instead.
@ghost ghost assigned phaller Nov 22, 2013
@phaller
Copy link
Contributor

phaller commented Nov 22, 2013

The Travis build only fails because Travis recently removed the oraclejdk6 JDK config. On master I've already replaced it with openjdk6.

@phaller
Copy link
Contributor

phaller commented Nov 22, 2013

LGTM

phaller added a commit that referenced this pull request Nov 22, 2013
Fix crashers in do/while and while(await(..))
@phaller phaller merged commit adbe51e into scala:master Nov 22, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

do/while crasher
2 participants