Dont' let null nodes sneak past cast instructions
authorChris Lattner <sabre@nondot.org>
Wed, 6 Oct 2004 19:29:13 +0000 (19:29 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 6 Oct 2004 19:29:13 +0000 (19:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16779 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/DataStructure/Local.cpp

index 070d03738d92125271a5f00ec8267d3556be9e27..b497c3849c93d2d1fe34598cdc9453db4c3c6831 100644 (file)
@@ -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