From 9608c81d01d0f0d7f8b4a9dea54d237d1a9d8276 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 25 May 2003 16:15:32 +0000 Subject: [PATCH] Fix problem with last checkin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6328 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/Constants.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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(); + } } -- 2.34.1