Fix a major problem with global variable initializers. This could cause
authorChris Lattner <sabre@nondot.org>
Tue, 29 Mar 2005 17:21:53 +0000 (17:21 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 29 Mar 2005 17:21:53 +0000 (17:21 +0000)
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

lib/Analysis/IPA/Andersens.cpp

index 9c17cab0e62d0585abda8db431dc66a8c461dcd7..ed9d54953e19e9d8867ac3785e9494b8ca16f1c7 100644 (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;