Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make p6capturelex not create a busted chain.
It didn't care what it shoved into .outer, meaning that we could put
entirely wrong things in there. This tries to do a bit better, though
really the longer-term solution is to fix up the code-gen, hopefully
by leaving the QAST compiler to work it out. In the meantime, this
seems to fix various lexical issues.
  • Loading branch information
jnthn committed Jun 30, 2013
1 parent 8ca095c commit 1e07ff8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/vm/jvm/runtime/org/perl6/rakudo/Ops.java
Expand Up @@ -443,7 +443,11 @@ public static SixModelObject p6capturelex(SixModelObject codeObj, ThreadContext
GlobalExt gcx = key.getGC(tc);
CodeRef closure = (CodeRef)codeObj.get_attribute_boxed(tc,
gcx.Code, "$!do", HINT_CODE_DO);
closure.outer = tc.curFrame;
StaticCodeInfo wantedStaticInfo = closure.staticInfo.outerStaticInfo;
if (tc.curFrame.codeRef.staticInfo == wantedStaticInfo)
closure.outer = tc.curFrame;
else if (tc.curFrame.outer.codeRef.staticInfo == wantedStaticInfo)
closure.outer = tc.curFrame.outer;
return codeObj;
}

Expand Down

0 comments on commit 1e07ff8

Please sign in to comment.