diff options
author | Chris Lattner <sabre@nondot.org> | 2004-10-06 19:29:13 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-10-06 19:29:13 +0000 |
commit | 157b2525f91f58508f970d6989135be260f9d5e7 (patch) | |
tree | 36a2b8cccbd353b61695e166cf67b1faf264b6b5 /lib/Analysis/DataStructure/Local.cpp | |
parent | f5d9fa7e78a2c5d57171a141020491d48222de22 (diff) |
Dont' let null nodes sneak past cast instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16779 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure/Local.cpp')
-rw-r--r-- | lib/Analysis/DataStructure/Local.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Analysis/DataStructure/Local.cpp b/lib/Analysis/DataStructure/Local.cpp index 070d03738d..b497c3849c 100644 --- a/lib/Analysis/DataStructure/Local.cpp +++ b/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 |