diff options
Diffstat (limited to 'lib/AsmParser/LLParser.cpp')
-rw-r--r-- | lib/AsmParser/LLParser.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp index 401dc39ca5..943f1d0025 100644 --- a/lib/AsmParser/LLParser.cpp +++ b/lib/AsmParser/LLParser.cpp @@ -471,8 +471,9 @@ bool LLParser::ParseGlobal(const std::string &Name, LocTy NameLoc, GlobalVariable *GV = 0; // See if the global was forward referenced, if so, use the global. - if (!Name.empty() && (GV = M->getGlobalVariable(Name, true))) { - if (!ForwardRefVals.erase(Name)) + if (!Name.empty()) { + if ((GV = M->getGlobalVariable(Name, true)) && + !ForwardRefVals.erase(Name)) return Error(NameLoc, "redefinition of global '@" + Name + "'"); } else { std::map<unsigned, std::pair<GlobalValue*, LocTy> >::iterator |