diff options
author | Chris Lattner <sabre@nondot.org> | 2009-02-02 07:24:28 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-02-02 07:24:28 +0000 |
commit | 91dad87ddc1e69ac5fa8953a583de4185e1dd0d7 (patch) | |
tree | 6a12e29325bb30cd38d867586b684ab1e4f7bc19 /lib/AsmParser/LLParser.cpp | |
parent | f5db1fbf7ac5b2a90807ef2f1be5fae3cecba5dd (diff) |
Fix PR3372
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63501 91177308-0d34-0410-b5e6-96231b3b80d8
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 |