Skip to content

Commit aee3289

Browse files
committed
Fix missed CompressPointer reset in EndSort when without-zlib
Reset of *AR.CompressPointer was the wrong side of an #ifdef WITHZLIB. Also fix the --without-zlib build, broken since the split sort allocation patch: 7d0e71d
1 parent 2323b84 commit aee3289

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

check/fixes.frm

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -962,6 +962,29 @@ L F7 = f(10000*g5_);
962962
#pend_if mpi?
963963
assert runtime_error?
964964
*--#] Issue94 :
965+
*--#[ Issue95b :
966+
#-
967+
#:filepatches 4
968+
#:largesize 25600
969+
#:maxtermsize 200
970+
#:smallsize 12800
971+
#:termsinsmall 16
972+
973+
Off stats;
974+
975+
#define N "323"
976+
S x,k;
977+
L F = sum_(k,1,`N',x^k);
978+
.sort
979+
980+
L CheckZero = F - {`N'*(`N'+1)/2};
981+
id x^k?pos_ = k;
982+
983+
Print CheckZero;
984+
.end
985+
assert succeeded?
986+
assert result("CheckZero") =~ expr("0")
987+
*--#] Issue95b :
965988
*--#[ Issue97_1 :
966989
* "Program terminating" with oldFactArg and dot products
967990
V e1, e2, k1, k2;

sources/sort.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1056,8 +1056,8 @@ LONG EndSort(PHEAD WORD *buffer, int par)
10561056
position = S->fPatches[S->fPatchN];
10571057
ss = S->sPointer;
10581058
if ( *ss ) {
1059-
#ifdef WITHZLIB
10601059
*AR.CompressPointer = 0;
1060+
#ifdef WITHZLIB
10611061
if ( S == AT.S0 && AR.NoCompress == 0 && AR.gzipCompress > 0 )
10621062
S->fpcompressed[S->fPatchN] = 1;
10631063
else
@@ -4841,8 +4841,10 @@ void CleanUpSort(int num)
48414841
M_free(S->inPatches, "CleanUpSort: inPatches");
48424842
M_free(S->tree, "CleanUpSort: tree");
48434843
M_free(S->used, "CleanUpSort: used");
4844+
#ifdef WITHZLIB
48444845
M_free(S->fpcompressed, "CleanUpSort: fpcompressed");
48454846
M_free(S->fpincompressed, "CleanUpSort: fpincompressed");
4847+
#endif
48464848
M_free(S->ktoi, "CleanUpSort: ktoi");
48474849
M_free(S->lBuffer, "CleanUpSort: lBuffer+sBuffer");
48484850
M_free(S->file.PObuffer, "CleanUpSort: PObuffer");

0 commit comments

Comments
 (0)