From 8d2275dc48f700ebc26e088d834102f9d9033140 Mon Sep 17 00:00:00 2001 From: Rangi Date: Sun, 19 Jul 2026 23:45:07 -0400 Subject: [PATCH] Use `rpnErrorAt` wrapper to ensure setting `isError` on all RPN errors Two possible RPN errors were missing `isError = true;` --- src/link/patch.cpp | 52 ++++++++++++++++++++-------------------------- 1 file changed, 23 insertions(+), 29 deletions(-) diff --git a/src/link/patch.cpp b/src/link/patch.cpp index 5c89e7fd..881b03cf 100644 --- a/src/link/patch.cpp +++ b/src/link/patch.cpp @@ -47,11 +47,16 @@ static bool isError = false; } \ } while (0) +#define rpnErrorAt(...) \ + do { \ + errorAt(__VA_ARGS__); \ + isError = true; \ + } while (0) + #define firstErrorAt(...) \ do { \ if (!isError) { \ - errorAt(__VA_ARGS__); \ - isError = true; \ + rpnErrorAt(__VA_ARGS__); \ } \ } while (0) @@ -283,16 +288,15 @@ static int32_t computeRPNExpr(Patch const &patch, std::vector const &fil if (symID >= fileSymbols.size()) { fatalAt(patch, "Requested `BANK()` of invalid symbol ID #%" PRIu32, symID); } else if (Symbol const *symbol = getSymbol(fileSymbols, symID); !symbol) { - errorAt( + rpnErrorAt( patch, "Requested `BANK()` of undefined symbol `%s`", fileSymbols[symID].name.c_str() ); - isError = true; value = 1; } else if (std::holds_alternative