Skip to content

Commit

Permalink
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions core/src/main/java/org/jruby/ir/runtime/IRRuntimeHelpers.java
Original file line number Diff line number Diff line change
@@ -128,19 +128,11 @@ public static IRubyObject initiateNonLocalReturn(ThreadContext context, DynamicS
// If not in a lambda, check if this was a non-local return
while (dynScope != null) {
StaticScope ss = dynScope.getStaticScope();
// SSS FIXME: Why is scopeType empty? Looks like this static-scope
// was not associated with the AST scope that got converted to IR.
//
// Ruby code: lambda { Thread.new { return }.join }.call
//
// To be investigated.
IRScopeType ssType = ss.getScopeType();
if (ssType != null) {
if (ssType.isMethodType() ||
(ss.isArgumentScope() && ssType.isClosureType() && ssType != IRScopeType.EVAL_SCRIPT) ||
(ssType.isClosureType() && dynScope.isLambda())) {
break;
}
if (ssType.isMethodType() ||
(ss.isArgumentScope() && ssType.isClosureType() && ssType != IRScopeType.EVAL_SCRIPT) ||
(ssType.isClosureType() && dynScope.isLambda())) {
break;
}
dynScope = dynScope.getParentScope();
}
@@ -159,7 +151,7 @@ public static IRubyObject handleNonlocalReturn(StaticScope scope, DynamicScope d

// If we are in the method scope we are supposed to return from, stop p<ropagating.
if (rj.methodToReturnFrom == dynScope) {
if (isDebug()) System.out.println("---> Non-local Return reached target in scope: " + dynScope + " matching dynscope? " + (rj.methodToReturnFrom == dynScope));
if (isDebug()) System.out.println("---> Non-local Return reached target in scope: " + dynScope);
return (IRubyObject) rj.returnValue;
}

0 comments on commit bdcf277

Please sign in to comment.