summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/DataStructure/Local.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-10-06 19:29:13 +0000
committerChris Lattner <sabre@nondot.org>2004-10-06 19:29:13 +0000
commitaf88fcd4c9d86f7ffe292bb724b06bed400471bf (patch)
treeab91edb21871da0030fb5ead05716fd43ac97a6b /llvm/lib/Analysis/DataStructure/Local.cpp
parentfe643e314fa06fc35d69a6b3fa4814920fb67ba1 (diff)
downloadbcm5719-llvm-af88fcd4c9d86f7ffe292bb724b06bed400471bf.tar.gz
bcm5719-llvm-af88fcd4c9d86f7ffe292bb724b06bed400471bf.zip
Dont' let null nodes sneak past cast instructions
llvm-svn: 16779
Diffstat (limited to 'llvm/lib/Analysis/DataStructure/Local.cpp')
-rw-r--r--llvm/lib/Analysis/DataStructure/Local.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/DataStructure/Local.cpp b/llvm/lib/Analysis/DataStructure/Local.cpp
index 070d03738d9..b497c3849c9 100644
--- a/llvm/lib/Analysis/DataStructure/Local.cpp
+++ b/llvm/lib/Analysis/DataStructure/Local.cpp
@@ -950,8 +950,11 @@ void GraphBuilder::visitFreeInst(FreeInst &FI) {
void GraphBuilder::visitCastInst(CastInst &CI) {
if (isPointerType(CI.getType()))
if (isPointerType(CI.getOperand(0)->getType())) {
+ DSNodeHandle Ptr = getValueDest(*CI.getOperand(0));
+ if (Ptr.getNode() == 0) return;
+
// Cast one pointer to the other, just act like a copy instruction
- setDestTo(CI, getValueDest(*CI.getOperand(0)));
+ setDestTo(CI, Ptr);
} else {
// Cast something (floating point, small integer) to a pointer. We need
// to track the fact that the node points to SOMETHING, just something we
OpenPOWER on IntegriCloud