1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 12:41:49 +01:00

Fix PR3372

llvm-svn: 63501
This commit is contained in:
Chris Lattner 2009-02-02 07:24:28 +00:00
parent 6402178a04
commit 11cfab6d5b
2 changed files with 9 additions and 2 deletions

View File

@ -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

View File

@ -0,0 +1,6 @@
; RUN: llvm-as < %s | llvm-dis
; PR3372
@X = global i32* @0
global i32 4