aboutsummaryrefslogtreecommitdiffstats
path: root/lib/AsmParser
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-02-02 07:24:28 +0000
committerChris Lattner <sabre@nondot.org>2009-02-02 07:24:28 +0000
commitdb6a6a1c32ccc7345190d83d5668d4fa77cc5413 (patch)
tree6a12e29325bb30cd38d867586b684ab1e4f7bc19 /lib/AsmParser
parentf3b445e53986535aad1823b313a50da902987f49 (diff)
downloadexternal_llvm-db6a6a1c32ccc7345190d83d5668d4fa77cc5413.zip
external_llvm-db6a6a1c32ccc7345190d83d5668d4fa77cc5413.tar.gz
external_llvm-db6a6a1c32ccc7345190d83d5668d4fa77cc5413.tar.bz2
Fix PR3372
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63501 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AsmParser')
-rw-r--r--lib/AsmParser/LLParser.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp
index 401dc39..943f1d0 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