Fix problem with last checkin.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6328 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2003-05-25 16:15:32 +00:00
parent 28fc440bc6
commit 9608c81d01

View File

@ -668,10 +668,12 @@ void ConstantPointerNull::refineAbstractType(const DerivedType *OldTy,
Value::refineAbstractType(OldTy, NewTy);
// Make everyone now use a constant of the new type...
replaceAllUsesWith(ConstantPointerNull::get(cast<PointerType>(NewTy)));
// This constant is now dead, destroy it.
destroyConstant();
if (NewTy != OldTy) {
replaceAllUsesWith(ConstantPointerNull::get(cast<PointerType>(NewTy)));
// This constant is now dead, destroy it.
destroyConstant();
}
}