-
-
Save headius/7f041aefb2330b6e8bcd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/core/src/main/java/org/jruby/ir/runtime/IRRuntimeHelpers.java b/core/src/main/java/org/jruby/ir/runtime/IRRuntimeHelpers.java | |
index c9746dd..ddc44a8 100644 | |
--- a/core/src/main/java/org/jruby/ir/runtime/IRRuntimeHelpers.java | |
+++ b/core/src/main/java/org/jruby/ir/runtime/IRRuntimeHelpers.java | |
@@ -183,21 +183,23 @@ public class IRRuntimeHelpers { | |
} | |
} | |
- @JIT | |
+ @Interp @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 | |
- throw IRException.BREAK_LocalJumpError.getException(context.getRuntime()); | |
- } else if (exc instanceof IRReturnJump && (blockType == null || inLambda(blockType))) { | |
+ if (((IRBreakJump)exc).scopeToReturnTo == dynScope) throw IRException.BREAK_LocalJumpError.getException(context.getRuntime()); | |
+ } | |
+ | |
+ 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment