Skip to content

Commit 9233615

Browse files
committed
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.
1 parent 7e7efde commit 9233615

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/vm/jvm/runtime/org/perl6/nqp/sixmodel/SerializationReader.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ public void deserialize() {
122122
deserializeContexts();
123123
attachClosureOuters(crCount);
124124
attachContextOuters();
125+
fixupContextOuters();
125126
}
126127

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

525+
private void fixupContextOuters() {
526+
for (int i = 0; i < contextTableEntries; i++) {
527+
if (contexts[i].outer == null &&
528+
contexts[i].codeRef.staticInfo.priorInvocation != null &&
529+
contexts[i].codeRef.staticInfo.priorInvocation.outer != null)
530+
contexts[i].outer = contexts[i].codeRef.staticInfo.priorInvocation.outer;
531+
}
532+
}
533+
524534
public SixModelObject readRef() {
525535
short discrim = orig.getShort();
526536
int elems;

0 commit comments

Comments
 (0)