Fix problem with last checkin.
authorChris Lattner <sabre@nondot.org>
Sun, 25 May 2003 16:15:32 +0000 (16:15 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 25 May 2003 16:15:32 +0000 (16:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6328 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Constants.cpp

index 76904ad3f97bacc1c20b5881c4678c12bcd8b811..8fa5342ff3b45a87a63e22471370826f3ec88d5a 100644 (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();
+  }
 }