From: Chris Lattner Date: Sun, 25 May 2003 16:15:32 +0000 (+0000) Subject: Fix problem with last checkin. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=9608c81d01d0f0d7f8b4a9dea54d237d1a9d8276;p=oota-llvm.git Fix problem with last checkin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6328 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp index 76904ad3f97..8fa5342ff3b 100644 --- a/lib/VMCore/Constants.cpp +++ b/lib/VMCore/Constants.cpp @@ -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(NewTy))); - - // This constant is now dead, destroy it. - destroyConstant(); + if (NewTy != OldTy) { + replaceAllUsesWith(ConstantPointerNull::get(cast(NewTy))); + + // This constant is now dead, destroy it. + destroyConstant(); + } }