From 44c926605101644ffeb4584354bf5f71171c480d Mon Sep 17 00:00:00 2001 From: Josh Davies Date: Sun, 19 May 2024 21:36:37 +0100 Subject: [PATCH] Pass the master struct in MasterMerge CompareTerms needs to be able to change flags in the caller's sort struct (PolyWise, for eg). Using the BHEAD macro here does not pass the right struct. This leads to polyratfun merging bugs when using tform -w2 (which disables the sortbots). I think changing the argument of MergeWithFloat won't do anything, but just in case some functionality is added there in the future... --- sources/threads.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sources/threads.c b/sources/threads.c index 3e6cf802..5296efe5 100644 --- a/sources/threads.c +++ b/sources/threads.c @@ -3736,10 +3736,7 @@ int MasterMerge(VOID) */ while ( i >>= 1 ) { if ( S->tree[i] > 0 ) { -/* - In the old setup we had here B0 for the first argument -*/ - if ( ( c = CompareTerms(BHEAD poin[S->tree[i]],poin[k],(WORD)0) ) > 0 ) { + if ( ( c = CompareTerms(B0, poin[S->tree[i]],poin[k],(WORD)0) ) > 0 ) { /* S->tree[i] is the smaller. Exchange and go on. */ @@ -3818,7 +3815,7 @@ int MasterMerge(VOID) WORD *term1, *term2; term1 = poin[S->tree[i]]; term2 = poin[k]; - if ( MergeWithFloat(BHEAD &term1,&term2) == 0 ) + if ( MergeWithFloat(B0, &term1,&term2) == 0 ) goto cancelled; poin[S->tree[i]] = term1; }