From 5ceaf630ab38dd76e62620746c7144a3c0386296 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 29 Mar 2005 17:21:53 +0000 Subject: [PATCH] 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 --- lib/Analysis/IPA/Andersens.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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(C->getType())) - N->addPointerTo(getNodeForConstantPointer(C)); + N->copyFrom(getNodeForConstantPointer(C)); + } else if (C->isNullValue()) { N->addPointerTo(&GraphNodes[NullObject]); return;