Skip to content

Commit

Permalink
fix #253:more COW fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tavmem committed Sep 29, 2014
1 parent f689f4f commit f166a08
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion kx.c
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ Z K ex2(V*v, K k) //execute words --- all returns must be Ks. v: word list, k:
if(1!=sva(v[1])){d=ex1(v+(offsetColon==v[1]?2:3),k,0,0,1); } // oom -- except it's ok for d to be 0 elsewhere
d=bk(d)?0:d;

if(cirRef(*w,d) || (((*w)->t==6 && d) && (d->t==0 || d->t==5)) ){
if(cirRef(*w,d) || (((*w)->t==6 && d) && (d->t==0 || d->t==5 || ABS(d->t)!=d->t)) ){
K x = d;
if(x->c) {d=kclone(x); cd(x);}
}
Expand Down
4 changes: 3 additions & 1 deletion tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,9 @@ Z I tests02()
TC_("(.((`a;;);(`b;;);(`c;;));.((`a;;);(`b;;);(`c;;));.((`a;;);(`b;;);(`c;;)))", "a:b:c:(.k;.k;.k);b") // #43 case 7b
TC_("(.((`a;;);(`b;;);(`c;;));.((`a;;);(`b;;);(`c;;));.((`a;;);(`b;;);(`c;;)))", "a:b:c:(.k;.k;.k);c") // #43 case 7c
TC_("(.((`x;;);(`y;;));.((`x;;);(`y;;)))", "x:y:(.k;.k);x") // #43 case 8x
TC_("(.((`x;;);(`y;;));.((`x;;);(`y;;)))", "x:y:(.k;.k);y") // #43 case 8y
TC_("(.((`x;;);(`y;;));.((`x;;);(`y;;)))", "x:y:(.k;.k);y") // #43 case 8y
TC(3 4 5, x:2 3#!6; y:x; z:y[1]; y[1;1]:99; z)
TC(3.1 4.1 5.1, x:.1+2 3#!6; y:x; z:y[1]; y[1;1]:99.1; z)

R 0;
}
Expand Down

0 comments on commit f166a08

Please sign in to comment.