Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Be more eager about owning STables.
  • Loading branch information
jnthn committed Mar 9, 2013
1 parent 6e9482f commit 5c9264f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/org/perl6/nqp/runtime/Ops.java
Expand Up @@ -2267,11 +2267,16 @@ public static SixModelObject createsc(String handle, ThreadContext tc) {
}
public static SixModelObject scsetobj(SixModelObject scRef, long idx, SixModelObject obj, ThreadContext tc) {
if (scRef instanceof SCRefInstance) {
ArrayList<SixModelObject> roots = ((SCRefInstance)scRef).referencedSC.root_objects;
SerializationContext sc = ((SCRefInstance)scRef).referencedSC;
ArrayList<SixModelObject> roots = sc.root_objects;
if (roots.size() == idx)
roots.add(obj);
else
roots.set((int)idx, obj);
if (obj.st.sc == null) {
sc.root_stables.add(obj.st);
obj.st.sc = sc;
}
return obj;
}
else {
Expand Down

0 comments on commit 5c9264f

Please sign in to comment.