Skip to content

Commit

Permalink
Revert "Only consider break jumps actually originating from this proc."
Browse files Browse the repository at this point in the history
This reverts commit fad37ea.

commit 85ffd61 eliminates the need for this extra logic.

Fixes #1270
  • Loading branch information
enebo committed Mar 20, 2015
1 parent 85ffd61 commit 3456198
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions core/src/main/java/org/jruby/ir/runtime/IRRuntimeHelpers.java
Expand Up @@ -187,23 +187,21 @@ public static IRubyObject initiateBreak(ThreadContext context, DynamicScope dynS
}
}

@Interp @JIT
@JIT
public static IRubyObject handleBreakAndReturnsInLambdas(ThreadContext context, StaticScope scope, DynamicScope dynScope, Object exc, Block.Type blockType) throws RuntimeException {
if ((exc instanceof IRBreakJump) && inNonMethodBodyLambda(scope, blockType)) {
// We just unwound all the way up because of a non-local break
if (((IRBreakJump)exc).scopeToReturnTo == dynScope) throw IRException.BREAK_LocalJumpError.getException(context.getRuntime());
}

if (exc instanceof IRReturnJump && (blockType == null || inLambda(blockType))) {
throw IRException.BREAK_LocalJumpError.getException(context.getRuntime());
} else if (exc instanceof IRReturnJump && (blockType == null || inLambda(blockType))) {
// Ignore non-local return processing in non-lambda blocks.
// Methods have a null blocktype
return handleNonlocalReturn(scope, dynScope, exc, blockType);
} else {
// Propagate
Helpers.throwException((Throwable)exc);
// should not get here
return null;
}

// Propagate
Helpers.throwException((Throwable)exc);
// should not get here
return null;
}

@JIT
Expand Down

0 comments on commit 3456198

Please sign in to comment.