Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fixup outers via priorInvocation
This will fix the long standing issue with our scoped subs which are use-d by another
package with gets precompiled. This showed up for URI in rakudo star for example.
  • Loading branch information
FROGGS committed Mar 11, 2015
1 parent 7e7efde commit 9233615
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/vm/jvm/runtime/org/perl6/nqp/sixmodel/SerializationReader.java
Expand Up @@ -122,6 +122,7 @@ public void deserialize() {
deserializeContexts();
attachClosureOuters(crCount);
attachContextOuters();
fixupContextOuters();
}

/* Checks the header looks sane and all of the places it points to make sense.
Expand Down Expand Up @@ -521,6 +522,15 @@ private void attachContextOuters() {
}
}

private void fixupContextOuters() {
for (int i = 0; i < contextTableEntries; i++) {
if (contexts[i].outer == null &&
contexts[i].codeRef.staticInfo.priorInvocation != null &&
contexts[i].codeRef.staticInfo.priorInvocation.outer != null)
contexts[i].outer = contexts[i].codeRef.staticInfo.priorInvocation.outer;
}
}

public SixModelObject readRef() {
short discrim = orig.getShort();
int elems;
Expand Down

0 comments on commit 9233615

Please sign in to comment.