Skip to content

Commit 87b4bcf

Browse files
jodaviestueda
authored andcommitted
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...
1 parent 74735f5 commit 87b4bcf

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

sources/threads.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3736,10 +3736,7 @@ int MasterMerge(VOID)
37363736
*/
37373737
while ( i >>= 1 ) {
37383738
if ( S->tree[i] > 0 ) {
3739-
/*
3740-
In the old setup we had here B0 for the first argument
3741-
*/
3742-
if ( ( c = CompareTerms(BHEAD poin[S->tree[i]],poin[k],(WORD)0) ) > 0 ) {
3739+
if ( ( c = CompareTerms(B0, poin[S->tree[i]],poin[k],(WORD)0) ) > 0 ) {
37433740
/*
37443741
S->tree[i] is the smaller. Exchange and go on.
37453742
*/
@@ -3818,7 +3815,7 @@ int MasterMerge(VOID)
38183815
WORD *term1, *term2;
38193816
term1 = poin[S->tree[i]];
38203817
term2 = poin[k];
3821-
if ( MergeWithFloat(BHEAD &term1,&term2) == 0 )
3818+
if ( MergeWithFloat(B0, &term1,&term2) == 0 )
38223819
goto cancelled;
38233820
poin[S->tree[i]] = term1;
38243821
}

0 commit comments

Comments
 (0)