From: Mark Wooding Date: Tue, 4 Apr 2006 16:17:30 +0000 (+0100) Subject: mpreduce: Debug decomposition corrupts initial state for code generator. X-Git-Tag: 2.1.1~23^2~5 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/catacomb/commitdiff_plain/f9c435c0c2f58c87699e1ef693388bc4df180ba0?ds=inline mpreduce: Debug decomposition corrupts initial state for code generator. The code generation pass uses whatever final state the debugging run left behind. Have the debug pass force the final state back to Z when it finishes. Also, produce correct output from the debugging pass. --- diff --git a/mpreduce.c b/mpreduce.c index 0f20ed80..52e86a1f 100644 --- a/mpreduce.c +++ b/mpreduce.c @@ -101,7 +101,8 @@ int mpreduce_create(mpreduce *r, mp *p) case X0 | 0: st = Z; printf("+ %lu\n", i - 1); break; } } - if (st >= X) printf("+ %lu\n", i); + if (st >= X) printf("+ %lu\n", i - 1); + st = Z; #endif for (i = 0, mp_scan(&sc, p); i < d - 1 && mp_step(&sc); i++) {