From cb1f619a266a18b424b5fa9d3b8e691f24b6b330 Mon Sep 17 00:00:00 2001 From: vermaseren Date: Tue, 28 Jul 2020 10:41:33 +0200 Subject: [PATCH] Repaired issue #307. Involved a fundamental flaw in TestSub in proces.c. --- sources/proces.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/sources/proces.c b/sources/proces.c index c26ea0a0..b54ca40f 100644 --- a/sources/proces.c +++ b/sources/proces.c @@ -1579,16 +1579,25 @@ Important: we may not have enough spots here } } if ( i > *t ) { +/* + We should not forget to correct the Nest + stack. That caused trouble in the past. +*/ retvalue = 1; i -= *t; - *t2 -= i; - t1[1] -= i; t += *t; r = t + i; - m = term + *term; + m = AN.EndNest; while ( r < m ) *t++ = *r++; - *term -= i; t = AT.NestPoin[-1].argsize + ARGHEAD; + n = AT.Nest; + while ( n < AT.NestPoin ) { + *(n->argsize) -= i; + *(n->funsize) -= i; + *(n->termsize) -= i; + n++; + } + AN.EndNest -= i; } } AN.subsubveto = 0; @@ -3160,7 +3169,8 @@ SkipCount: level++; if ( AR.CurDum > AM.IndDum && AR.sLevel <= 0 ) { WORD olddummies = AN.IndDum; AN.IndDum = AM.IndDum; - ReNumber(BHEAD term); Normalize(BHEAD term); + ReNumber(BHEAD term); + Normalize(BHEAD term); AN.IndDum = olddummies; if ( !*term ) goto Return0; olddummies = DetCurDum(BHEAD term);