aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCParser/AsmParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/MC/MCParser/AsmParser.cpp')
-rw-r--r--llvm/lib/MC/MCParser/AsmParser.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp
index c5611a38..7782dc1 100644
--- a/llvm/lib/MC/MCParser/AsmParser.cpp
+++ b/llvm/lib/MC/MCParser/AsmParser.cpp
@@ -6273,7 +6273,8 @@ bool parseAssignmentExpression(StringRef Name, bool allow_redef,
// used as a symbol, or it is an absolute symbol).
Sym = Parser.getContext().lookupSymbol(Name);
if (Sym) {
- if (!Sym->isUnset() && (!allow_redef || !Sym->isRedefinable()))
+ if ((Sym->isVariable() || Sym->isDefined()) &&
+ (!allow_redef || !Sym->isRedefinable()))
return Parser.Error(EqualLoc, "redefinition of '" + Name + "'");
// If the symbol is redefinable, clone it and update the symbol table
// to the new symbol. Existing references to the original symbol remain