diff options
author | Chris Lattner <sabre@nondot.org> | 2005-03-29 17:21:53 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-03-29 17:21:53 +0000 |
commit | ca85130b0a2c37c3534b92ba2bd4fcf402c6334d (patch) | |
tree | 3b1c778c850ff5ae1ec9b4936bd83d1ec1c431b1 /llvm/lib | |
parent | 1ce9aacf2e7bbd9fb3489e59f24fcea955d679b7 (diff) | |
download | bcm5719-llvm-ca85130b0a2c37c3534b92ba2bd4fcf402c6334d.tar.gz bcm5719-llvm-ca85130b0a2c37c3534b92ba2bd4fcf402c6334d.zip |
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
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Analysis/IPA/Andersens.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/IPA/Andersens.cpp b/llvm/lib/Analysis/IPA/Andersens.cpp index 9c17cab0e62..ed9d54953e1 100644 --- a/llvm/lib/Analysis/IPA/Andersens.cpp +++ b/llvm/lib/Analysis/IPA/Andersens.cpp @@ -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; |