diff --git a/src/vm/jvm/runtime/org/perl6/nqp/runtime/CallFrame.java b/src/vm/jvm/runtime/org/perl6/nqp/runtime/CallFrame.java index 90ddb1a387..7a9692b365 100644 --- a/src/vm/jvm/runtime/org/perl6/nqp/runtime/CallFrame.java +++ b/src/vm/jvm/runtime/org/perl6/nqp/runtime/CallFrame.java @@ -138,6 +138,7 @@ public CallFrame(ThreadContext tc, CodeRef cr) { int numoLex = sci.oLexStatic.length; this.oLex = new SixModelObject[numoLex]; for (int i = 0; i < numoLex; i++) { + // 0 = static, 1 = clone, 2 = state switch (sci.oLexStaticFlags[i]) { case 0: this.oLex[i] = sci.oLexStatic[i]; @@ -148,6 +149,7 @@ public CallFrame(ThreadContext tc, CodeRef cr) { case 2: if (cr.oLexState == null) { cr.oLexState = new SixModelObject[sci.oLexStatic.length]; + cr.oLexStateIsHllInit = new boolean[sci.oLexStatic.length]; this.stateInit = true; } if (cr.oLexState[i] == null) diff --git a/src/vm/jvm/runtime/org/perl6/nqp/runtime/CodeRef.java b/src/vm/jvm/runtime/org/perl6/nqp/runtime/CodeRef.java index 39f28fa83d..c17c37b962 100644 --- a/src/vm/jvm/runtime/org/perl6/nqp/runtime/CodeRef.java +++ b/src/vm/jvm/runtime/org/perl6/nqp/runtime/CodeRef.java @@ -38,6 +38,11 @@ public class CodeRef extends SixModelObject { */ public SixModelObject[] oLexState; + /** + * Has the given statevar been assigned a value by the HLL? + */ + public boolean[] oLexStateIsHllInit; + /** * The (human-readable) name of the code-ref (not in staticInfo as a * number of places want to tweak it per closure clone). diff --git a/src/vm/jvm/runtime/org/perl6/nqp/runtime/StaticCodeInfo.java b/src/vm/jvm/runtime/org/perl6/nqp/runtime/StaticCodeInfo.java index a3a5c6aa9f..de216821c7 100644 --- a/src/vm/jvm/runtime/org/perl6/nqp/runtime/StaticCodeInfo.java +++ b/src/vm/jvm/runtime/org/perl6/nqp/runtime/StaticCodeInfo.java @@ -55,6 +55,7 @@ public class StaticCodeInfo implements Cloneable { /** * Flags for each static lexical usage. + * 0 = static, 1 = clone, 2 = state */ public byte[] oLexStaticFlags;