From 02439b18c0023914c97a355440bb401297e973b9 Mon Sep 17 00:00:00 2001 From: Rangi42 Date: Sun, 15 Sep 2024 00:00:00 -0400 Subject: [PATCH] `\#` will always be defined inside macros This lets the case structure here match the other branches --- src/asm/lexer.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/asm/lexer.cpp b/src/asm/lexer.cpp index 401ae028..b629349f 100644 --- a/src/asm/lexer.cpp +++ b/src/asm/lexer.cpp @@ -660,10 +660,13 @@ static std::shared_ptr readMacroArg(char name) { return str; } else if (name == '#') { MacroArgs *macroArgs = fstk_GetCurrentMacroArgs(); - auto str = macroArgs ? macroArgs->getAllArgs() : nullptr; - if (!str) { + if (!macroArgs) { error("'\\#' cannot be used outside of a macro\n"); + return nullptr; } + + auto str = macroArgs->getAllArgs(); + assume(str); // '\#' should always be defined (at least as an empty string) return str; } else if (name == '<') { uint32_t num = readBracketedMacroArgNum();