1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00

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.  

llvm-svn: 223370
This commit is contained in:
Philip Reames 2014-12-04 17:27:58 +00:00
parent ee0ef204ca
commit 2131f02187

View File

@ -51,7 +51,7 @@ bool llvm::isGCResult(const ImmutableCallSite &CS) {
return isGCResult(CS.getInstruction()); return isGCResult(CS.getInstruction());
} }
bool llvm::isGCResult(const Instruction *inst) { 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()) { if (Function *F = call->getCalledFunction()) {
return (F->getIntrinsicID() == Intrinsic::experimental_gc_result_int || return (F->getIntrinsicID() == Intrinsic::experimental_gc_result_int ||
F->getIntrinsicID() == Intrinsic::experimental_gc_result_float || F->getIntrinsicID() == Intrinsic::experimental_gc_result_float ||