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)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20922 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2005-03-29 17:21:53 +00:00
parent 848132d671
commit 76bc5ce5c4

View File

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