Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions check/fixes.frm
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,63 @@ L F7 = f(10000*g5_);
#pend_if mpi?
assert runtime_error?
*--#] Issue94 :
*--#[ Issue95 :
#-
#: filepatches 32
#: largepatches 32
#: largesize 6250000
#: maxtermsize 1250
#: smallsize 1250000
#: smallextension 2500032
#: termsinsmall 12500

Off Statistics;

Symbol x,n;

* One fewer term than reported in the Issue, since now the
* non-x term is in the initial definition of test.
#define NTERMS "266905"

Local test = sum_(n,1,`NTERMS',x^n) - `NTERMS'*(`NTERMS'+1)/2;
.sort

* Check all terms present
Identify x^n?pos_ = n;

Print;
.end
# This takes a long time for tform under valgrind.
# tform -w4 also doesn't crash here anyway (but -w2 does).
#pend_if valgrind? && threaded?
# Also doesn't run properly for 32bit form.
#require wordsize >= 4
assert succeeded?
assert result("test") =~ expr("0")
*--#] Issue95 :
*--#[ Issue95b :
#-
#:filepatches 4
#:largesize 25600
#:maxtermsize 200
#:smallsize 12800
#:termsinsmall 16

Off stats;

#define N "323"
S x,k;
L F = sum_(k,1,`N',x^k);
.sort

L CheckZero = F - {`N'*(`N'+1)/2};
id x^k?pos_ = k;

Print CheckZero;
.end
assert succeeded?
assert result("CheckZero") =~ expr("0")
*--#] Issue95b :
*--#[ Issue97_1 :
* "Program terminating" with oldFactArg and dot products
V e1, e2, k1, k2;
Expand Down
4 changes: 3 additions & 1 deletion sources/sort.c
Original file line number Diff line number Diff line change
Expand Up @@ -1056,8 +1056,8 @@ LONG EndSort(PHEAD WORD *buffer, int par)
position = S->fPatches[S->fPatchN];
ss = S->sPointer;
if ( *ss ) {
#ifdef WITHZLIB
*AR.CompressPointer = 0;
#ifdef WITHZLIB
if ( S == AT.S0 && AR.NoCompress == 0 && AR.gzipCompress > 0 )
S->fpcompressed[S->fPatchN] = 1;
else
Expand Down Expand Up @@ -4841,8 +4841,10 @@ void CleanUpSort(int num)
M_free(S->inPatches, "CleanUpSort: inPatches");
M_free(S->tree, "CleanUpSort: tree");
M_free(S->used, "CleanUpSort: used");
#ifdef WITHZLIB
M_free(S->fpcompressed, "CleanUpSort: fpcompressed");
M_free(S->fpincompressed, "CleanUpSort: fpincompressed");
#endif
M_free(S->ktoi, "CleanUpSort: ktoi");
M_free(S->lBuffer, "CleanUpSort: lBuffer+sBuffer");
M_free(S->file.PObuffer, "CleanUpSort: PObuffer");
Expand Down
Loading