Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix an array cloning bug.
  • Loading branch information
jnthn committed Feb 28, 2013
1 parent 1ca4a94 commit 4b14a9f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/org/perl6/nqp/sixmodel/reprs/VMArrayInstance.java
Expand Up @@ -252,7 +252,8 @@ private void memmove(SixModelObject[] slots, long dest_start, long src_start, lo
public SixModelObject clone(ThreadContext tc) {
try {
VMArrayInstance clone = (VMArrayInstance)this.clone();
clone.slots = this.slots.clone();
if (this.slots != null)
clone.slots = this.slots.clone();
return clone;
} catch (CloneNotSupportedException e) {
throw new RuntimeException(e);
Expand Down
3 changes: 2 additions & 1 deletion src/org/perl6/nqp/sixmodel/reprs/VMArrayInstance_i.java
Expand Up @@ -257,7 +257,8 @@ private void memmove(long[] slots, long dest_start, long src_start, long l_n) {
public SixModelObject clone(ThreadContext tc) {
try {
VMArrayInstance_i clone = (VMArrayInstance_i)this.clone();
clone.slots = this.slots.clone();
if (clone.slots != null)
clone.slots = this.slots.clone();
return clone;
} catch (CloneNotSupportedException e) {
throw new RuntimeException(e);
Expand Down
3 changes: 2 additions & 1 deletion src/org/perl6/nqp/sixmodel/reprs/VMArrayInstance_n.java
Expand Up @@ -257,7 +257,8 @@ private void memmove(double[] slots, long dest_start, long src_start, long l_n)
public SixModelObject clone(ThreadContext tc) {
try {
VMArrayInstance_n clone = (VMArrayInstance_n)this.clone();
clone.slots = this.slots.clone();
if (clone.slots != null)
clone.slots = this.slots.clone();
return clone;
} catch (CloneNotSupportedException e) {
throw new RuntimeException(e);
Expand Down
3 changes: 2 additions & 1 deletion src/org/perl6/nqp/sixmodel/reprs/VMArrayInstance_s.java
Expand Up @@ -257,7 +257,8 @@ private void memmove(String[] slots, long dest_start, long src_start, long l_n)
public SixModelObject clone(ThreadContext tc) {
try {
VMArrayInstance_s clone = (VMArrayInstance_s)this.clone();
clone.slots = this.slots.clone();
if (clone.slots != null)
clone.slots = this.slots.clone();
return clone;
} catch (CloneNotSupportedException e) {
throw new RuntimeException(e);
Expand Down

0 comments on commit 4b14a9f

Please sign in to comment.