Store IF depth relative to each fstack context

This disallows starting/ending an IF inside an
INCLUDEd file or a macro expansion
This commit is contained in:
Rangi
2021-01-08 16:28:51 -05:00
committed by Eldred Habert
parent 62bea23c49
commit cab9cb06a3
12 changed files with 64 additions and 21 deletions

View File

@@ -46,7 +46,7 @@ const size_t cldefine_entrysize = 2 * sizeof(void *);
char **cldefines;
clock_t nStartClock, nEndClock;
uint32_t nTotalLines, nIFDepth;
uint32_t nTotalLines;
#if defined(YYDEBUG) && YYDEBUG
extern int yydebug;
@@ -488,7 +488,6 @@ int main(int argc, char *argv[])
nStartClock = clock();
nTotalLines = 0;
nIFDepth = 0;
sym_Init(now);
sym_SetExportAll(exportall);
@@ -502,10 +501,6 @@ int main(int argc, char *argv[])
if (dependfile)
fclose(dependfile);
if (nIFDepth != 0)
errx(1, "Unterminated IF construct (%" PRIu32 " levels)!",
nIFDepth);
sect_CheckUnionClosed();
double timespent;