mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-26 23:32:58 +00:00
Fix PR3372
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63501 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f5db1fbf7a
commit
91dad87ddc
@ -471,8 +471,9 @@ bool LLParser::ParseGlobal(const std::string &Name, LocTy NameLoc,
|
|||||||
GlobalVariable *GV = 0;
|
GlobalVariable *GV = 0;
|
||||||
|
|
||||||
// See if the global was forward referenced, if so, use the global.
|
// See if the global was forward referenced, if so, use the global.
|
||||||
if (!Name.empty() && (GV = M->getGlobalVariable(Name, true))) {
|
if (!Name.empty()) {
|
||||||
if (!ForwardRefVals.erase(Name))
|
if ((GV = M->getGlobalVariable(Name, true)) &&
|
||||||
|
!ForwardRefVals.erase(Name))
|
||||||
return Error(NameLoc, "redefinition of global '@" + Name + "'");
|
return Error(NameLoc, "redefinition of global '@" + Name + "'");
|
||||||
} else {
|
} else {
|
||||||
std::map<unsigned, std::pair<GlobalValue*, LocTy> >::iterator
|
std::map<unsigned, std::pair<GlobalValue*, LocTy> >::iterator
|
||||||
|
6
test/Assembler/2009-02-01-UnnamedForwardRef.ll
Normal file
6
test/Assembler/2009-02-01-UnnamedForwardRef.ll
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
; RUN: llvm-as < %s | llvm-dis
|
||||||
|
; PR3372
|
||||||
|
|
||||||
|
@X = global i32* @0
|
||||||
|
global i32 4
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user