From: ggn Date: Mon, 16 Nov 2015 11:39:50 +0000 (+0200) Subject: Fix for assembly getting stuck in an infinite loop when a INCLUDEd file inside an... X-Git-Tag: v2.1.0~176 X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=commitdiff_plain;h=bb77eaee83ffa56a181fa1b92f4ea7de248a3af4 Fix for assembly getting stuck in an infinite loop when a INCLUDEd file inside an if/endif statement contains unbalanced if/endifs. --- diff --git a/token.c b/token.c index 84faa8f..3031895 100644 --- a/token.c +++ b/token.c @@ -912,8 +912,13 @@ retry: if ((ln = GetNextLine()) == NULL) { if (verb_flag) printf("TokenizeLine: Calling fpop() from SRC_IFILE...\n"); - fpop(); // Pop input level - goto retry; // Try for more lines + if (fpop() == 0) // Pop input level + goto retry; // Try for more lines + else + { + ifent->if_prev = (IFENT *) - 1; //Signal Assemble() that we have reached EOF with unbalanced if/endifs + return TKEOF; + } } curlineno++; // Bump line number