1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

Fix a major problem with global variable initializers. This could cause

us to have stuff pointing to the null pointer, which makes no sense
(the null ptr is an ssa value, not the null object)

llvm-svn: 20922
This commit is contained in:
Chris Lattner 2005-03-29 17:21:53 +00:00
parent 3759d20b0f
commit 5ceaf630ab

View File

@ -578,7 +578,8 @@ Andersens::Node *Andersens::getNodeForConstantPointerTarget(Constant *C) {
void Andersens::AddGlobalInitializerConstraints(Node *N, Constant *C) { void Andersens::AddGlobalInitializerConstraints(Node *N, Constant *C) {
if (C->getType()->isFirstClassType()) { if (C->getType()->isFirstClassType()) {
if (isa<PointerType>(C->getType())) if (isa<PointerType>(C->getType()))
N->addPointerTo(getNodeForConstantPointer(C)); N->copyFrom(getNodeForConstantPointer(C));
} else if (C->isNullValue()) { } else if (C->isNullValue()) {
N->addPointerTo(&GraphNodes[NullObject]); N->addPointerTo(&GraphNodes[NullObject]);
return; return;