]> granicus.if.org Git - clang/commitdiff
Check void type before using replaceAllUsesWith().
authorDevang Patel <dpatel@apple.com>
Tue, 13 Oct 2009 22:59:11 +0000 (22:59 +0000)
committerDevang Patel <dpatel@apple.com>
Tue, 13 Oct 2009 22:59:11 +0000 (22:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84050 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CodeGenModule.cpp

index d84a397a7f4276f75e97c91a70a4a2a41865ef92..d091157f87751c4581cc2dc335fc42c2988cab8e 100644 (file)
@@ -1110,7 +1110,8 @@ static void ReplaceUsesOfNonProtoTypeWithRealFunction(llvm::GlobalValue *Old,
     NewCall->setCallingConv(CI->getCallingConv());
 
     // Finally, remove the old call, replacing any uses with the new one.
-    CI->replaceAllUsesWith(NewCall);
+    if (CI->getType() != llvm::Type::getVoidTy(CI->getContext()))
+        CI->replaceAllUsesWith(NewCall);
 
     CI->eraseFromParent();
   }