Save and restore opt r on the stack. (#1178)

Fixes #1174
This commit is contained in:
Rangi
2023-10-26 16:54:42 -04:00
committed by GitHub
parent a15f1a52c7
commit 22def89760

View File

@@ -275,6 +275,8 @@ void opt_Push(void)
entry->warningsAreErrors = warningsAreErrors; entry->warningsAreErrors = warningsAreErrors;
memcpy(entry->warningStates, warningStates, sizeof(warningStates)); memcpy(entry->warningStates, warningStates, sizeof(warningStates));
entry->maxRecursionDepth = maxRecursionDepth; // Pulled from fstack.h
entry->next = stack; entry->next = stack;
stack = entry; stack = entry;
} }
@@ -296,6 +298,7 @@ void opt_Pop(void)
opt_h(entry->haltnop); opt_h(entry->haltnop);
opt_L(entry->optimizeLoads); opt_L(entry->optimizeLoads);
opt_l(entry->warnOnLdOpt); opt_l(entry->warnOnLdOpt);
opt_R(entry->maxRecursionDepth);
// opt_W does not apply a whole warning state; it processes one flag string // opt_W does not apply a whole warning state; it processes one flag string
warningsAreErrors = entry->warningsAreErrors; warningsAreErrors = entry->warningsAreErrors;