summaryrefslogtreecommitdiff
path: root/lib/Analysis
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-03-29 17:21:53 +0000
committerChris Lattner <sabre@nondot.org>2005-03-29 17:21:53 +0000
commit76bc5ce5c4869408bc81ba40c8bde055a2047af0 (patch)
treebc4e6d8cfb0903bb2b774879361a110f499e8603 /lib/Analysis
parent848132d671c12df1dd04ec54f3e27b551f6e2803 (diff)
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
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/IPA/Andersens.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Analysis/IPA/Andersens.cpp b/lib/Analysis/IPA/Andersens.cpp
index 9c17cab0e62..ed9d54953e1 100644
--- a/lib/Analysis/IPA/Andersens.cpp
+++ b/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;