Dont' let null nodes sneak past cast instructions

llvm-svn: 16779
This commit is contained in:
Chris Lattner 2004-10-06 19:29:13 +00:00
parent fe643e314f
commit af88fcd4c9
1 changed files with 4 additions and 1 deletions

View 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