Skip to content

Commit

Permalink
Reset scope state after adding GEB for lambdas
Browse files Browse the repository at this point in the history
* Fixes crashers running specs with all passes enabled.
  • Loading branch information
subbuss committed Sep 29, 2014
1 parent 22291ec commit 929ffb9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions core/src/main/java/org/jruby/ir/IRScope.java
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,10 @@ public synchronized Instr[] prepareForInterpretation(boolean isLambda) {
if (isLambda) {
// Add a global ensure block to catch uncaught breaks
// and throw a LocalJumpError.
((IRClosure)this).addGEBForUncaughtBreaks();
if (((IRClosure)this).addGEBForUncaughtBreaks()) {
resetState();
computeScopeFlags();
}
}

runCompilerPasses(getManager().getCompilerPasses(this));
Expand Down Expand Up @@ -631,7 +634,10 @@ public synchronized List<BasicBlock> prepareForCompilation() {
// Add a global ensure block to catch uncaught breaks
// and throw a LocalJumpError.
if (this instanceof IRClosure) {
((IRClosure)this).addGEBForUncaughtBreaks();
if (((IRClosure)this).addGEBForUncaughtBreaks()) {
resetState();
computeScopeFlags();
}
}

runCompilerPasses(getManager().getJITPasses(this));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ void markDeadInstructions() {
Integer dv = problem.getDFVar(v);

// If 'v' is not live at the instruction site, and it has no side effects, mark it dead!
// System.out.println("df var for " + v + " is " + dv.getId());
// System.out.println("df var for " + v + " is " + dv);
if (living.get(dv)) {
living.clear(dv);
// System.out.println("NO! LIVE result:" + v);
Expand Down

0 comments on commit 929ffb9

Please sign in to comment.