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