From 22def89760a80fc2c1debdebf737eaf1ab7fce42 Mon Sep 17 00:00:00 2001 From: Rangi <35663410+Rangi42@users.noreply.github.com> Date: Thu, 26 Oct 2023 16:54:42 -0400 Subject: [PATCH] Save and restore `opt r` on the stack. (#1178) Fixes #1174 --- src/asm/opt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/asm/opt.c b/src/asm/opt.c index e31afd54..6ca764d6 100644 --- a/src/asm/opt.c +++ b/src/asm/opt.c @@ -275,6 +275,8 @@ void opt_Push(void) entry->warningsAreErrors = warningsAreErrors; memcpy(entry->warningStates, warningStates, sizeof(warningStates)); + entry->maxRecursionDepth = maxRecursionDepth; // Pulled from fstack.h + entry->next = stack; stack = entry; } @@ -296,6 +298,7 @@ void opt_Pop(void) opt_h(entry->haltnop); opt_L(entry->optimizeLoads); opt_l(entry->warnOnLdOpt); + opt_R(entry->maxRecursionDepth); // opt_W does not apply a whole warning state; it processes one flag string warningsAreErrors = entry->warningsAreErrors;