Skip to content

Commit

Permalink
Quick fix for crash by replace_ with nested functions
Browse files Browse the repository at this point in the history
Close #106.
  • Loading branch information
tueda committed Aug 5, 2016
1 parent 24f1772 commit 2e409bc
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
27 changes: 27 additions & 0 deletions check/fixes.frm
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,33 @@ assert succeeded?
assert result("F") =~ expr("f(p.p)")
assert result("G") =~ expr("f(0)")
*--#] Issue105 :
*--#[ Issue106 :
* Crash with replace_ and nested functions
cfunction prop, mom;
vector q1, q2, k1, k2, p;

l test = prop(mom(-q1-q2+p));
multiply replace_(q1,k1-k2);
print+s;
.sort
multiply replace_(q2,k2);
print+s;
.end

CF f,g;
V p1,p2;
L F1 = f(f(p1-p2));
L F2 = f(f(f(p1-p2)));
L F3 = f(f(f(f(p1-p2)+g(p1-p2))+g(p1-p2)));
multiply replace_(p1,p2);
P;
.end
assert succeeded?
assert result("test") =~ expr("+ prop(mom(- k1 + p))")
assert result("F1") =~ expr("f(f(0))")
assert result("F2") =~ expr("f(f(f(0)))")
assert result("F3") =~ expr("f(f(f(f(0)+g(0))+g(0)))")
*--#] Issue106 :
*--#[ Issue111 :
* PolyRatFun(expand) doesn't expand numeric coefficients in one go
S x;
Expand Down
4 changes: 4 additions & 0 deletions sources/proces.c
Original file line number Diff line number Diff line change
Expand Up @@ -1461,6 +1461,10 @@ Important: we may not have enough spots here
return(retvalue);
}
else {
/*
* Somehow the next line fixes Issue #106.
*/
i = *t;
Normalize(BHEAD t);
/* if ( i > *t ) { retvalue = 1; goto redosize; } */
/*
Expand Down

0 comments on commit 2e409bc

Please sign in to comment.