Skip to content

Commit 3456198

Browse files
committed
Revert "Only consider break jumps actually originating from this proc."
This reverts commit fad37ea. commit 85ffd61 eliminates the need for this extra logic. Fixes #1270
1 parent 85ffd61 commit 3456198

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

core/src/main/java/org/jruby/ir/runtime/IRRuntimeHelpers.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -187,23 +187,21 @@ public static IRubyObject initiateBreak(ThreadContext context, DynamicScope dynS
187187
}
188188
}
189189

190-
@Interp @JIT
190+
@JIT
191191
public static IRubyObject handleBreakAndReturnsInLambdas(ThreadContext context, StaticScope scope, DynamicScope dynScope, Object exc, Block.Type blockType) throws RuntimeException {
192192
if ((exc instanceof IRBreakJump) && inNonMethodBodyLambda(scope, blockType)) {
193193
// We just unwound all the way up because of a non-local break
194-
if (((IRBreakJump)exc).scopeToReturnTo == dynScope) throw IRException.BREAK_LocalJumpError.getException(context.getRuntime());
195-
}
196-
197-
if (exc instanceof IRReturnJump && (blockType == null || inLambda(blockType))) {
194+
throw IRException.BREAK_LocalJumpError.getException(context.getRuntime());
195+
} else if (exc instanceof IRReturnJump && (blockType == null || inLambda(blockType))) {
198196
// Ignore non-local return processing in non-lambda blocks.
199197
// Methods have a null blocktype
200198
return handleNonlocalReturn(scope, dynScope, exc, blockType);
199+
} else {
200+
// Propagate
201+
Helpers.throwException((Throwable)exc);
202+
// should not get here
203+
return null;
201204
}
202-
203-
// Propagate
204-
Helpers.throwException((Throwable)exc);
205-
// should not get here
206-
return null;
207205
}
208206

209207
@JIT

0 commit comments

Comments
 (0)