summaryrefslogtreecommitdiff
path: root/lib/MC/MCParser/AsmParser.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2012-05-03 16:50:55 +0000
committerDimitry Andric <dim@FreeBSD.org>2012-05-03 16:50:55 +0000
commitb61ab53cb789e568acbb2952fbead20ab853a696 (patch)
tree8575c732129e272992ac5d7b4c2519238fff4735 /lib/MC/MCParser/AsmParser.cpp
parent63faed5b8e4f2755f127fcb8aa440480c0649327 (diff)
Diffstat (limited to 'lib/MC/MCParser/AsmParser.cpp')
-rw-r--r--lib/MC/MCParser/AsmParser.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/MC/MCParser/AsmParser.cpp b/lib/MC/MCParser/AsmParser.cpp
index 2d61cac62585b..8aef43cb0b4cf 100644
--- a/lib/MC/MCParser/AsmParser.cpp
+++ b/lib/MC/MCParser/AsmParser.cpp
@@ -1527,11 +1527,11 @@ bool AsmParser::HandleMacroEntry(StringRef Name, SMLoc NameLoc,
}
Lex();
}
- // If there weren't any arguments, erase the token vector so everything
- // else knows that. Leaving around the vestigal empty token list confuses
- // things.
- if (MacroArguments.size() == 1 && MacroArguments.back().empty())
- MacroArguments.clear();
+ // If the last argument didn't end up with any tokens, it's not a real
+ // argument and we should remove it from the list. This happens with either
+ // a tailing comma or an empty argument list.
+ if (MacroArguments.back().empty())
+ MacroArguments.pop_back();
// Macro instantiation is lexical, unfortunately. We construct a new buffer
// to hold the macro body with substitutions.