From ad90e3ad14488b9b78d2ac4dd39f02ce2e35f264 Mon Sep 17 00:00:00 2001 From: Philip Reames Date: Thu, 4 Dec 2014 17:27:58 +0000 Subject: [PATCH] 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223370 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/IR/Statepoint.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/IR/Statepoint.cpp b/lib/IR/Statepoint.cpp index 8096913b01e..a04f6738dcb 100644 --- a/lib/IR/Statepoint.cpp +++ b/lib/IR/Statepoint.cpp @@ -51,7 +51,7 @@ bool llvm::isGCResult(const ImmutableCallSite &CS) { return isGCResult(CS.getInstruction()); } bool llvm::isGCResult(const Instruction *inst) { - if (const CallInst *call = cast(inst)) { + if (const CallInst *call = dyn_cast(inst)) { if (Function *F = call->getCalledFunction()) { return (F->getIntrinsicID() == Intrinsic::experimental_gc_result_int || F->getIntrinsicID() == Intrinsic::experimental_gc_result_float ||