\# will always be defined inside macros

This lets the case structure here match the other branches
This commit is contained in:
Rangi42
2024-09-15 00:00:00 -04:00
parent 122ef95d9c
commit 02439b18c0

View File

@@ -660,10 +660,13 @@ static std::shared_ptr<std::string> readMacroArg(char name) {
return str; return str;
} else if (name == '#') { } else if (name == '#') {
MacroArgs *macroArgs = fstk_GetCurrentMacroArgs(); MacroArgs *macroArgs = fstk_GetCurrentMacroArgs();
auto str = macroArgs ? macroArgs->getAllArgs() : nullptr; if (!macroArgs) {
if (!str) {
error("'\\#' cannot be used outside of a macro\n"); 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; return str;
} else if (name == '<') { } else if (name == '<') {
uint32_t num = readBracketedMacroArgNum(); uint32_t num = readBracketedMacroArgNum();