[llvm] r223370 - Fix a typo: use of cast where dyn_cast was intended

Philip Reames listmail at philipreames.com
Thu Dec 4 09:27:58 PST 2014


Author: reames
Date: Thu Dec  4 11:27:58 2014
New Revision: 223370

URL: http://llvm.org/viewvc/llvm-project?rev=223370&view=rev
Log:
Fix a typo: use of cast where dyn_cast was intended

This bug has the effect of converting a test of isGCRelocate(InvokeInst*) from a false return to a crash.  

This may be the root cause of the crash Joerg reported against r223137, but I'm still waiting for a clean build of clang to complete to be able to confirm.  Once I've confirmed the issue, I'll submit a test case separately.  


Modified:
    llvm/trunk/lib/IR/Statepoint.cpp

Modified: llvm/trunk/lib/IR/Statepoint.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Statepoint.cpp?rev=223370&r1=223369&r2=223370&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Statepoint.cpp (original)
+++ llvm/trunk/lib/IR/Statepoint.cpp Thu Dec  4 11:27:58 2014
@@ -51,7 +51,7 @@ bool llvm::isGCResult(const ImmutableCal
   return isGCResult(CS.getInstruction());
 }
 bool llvm::isGCResult(const Instruction *inst) {
-  if (const CallInst *call = cast<CallInst>(inst)) {
+  if (const CallInst *call = dyn_cast<CallInst>(inst)) {
     if (Function *F = call->getCalledFunction()) {
       return (F->getIntrinsicID() == Intrinsic::experimental_gc_result_int ||
               F->getIntrinsicID() == Intrinsic::experimental_gc_result_float ||





More information about the llvm-commits mailing list