From a7dfbc03661fc303891370de95e160ab66769eb0 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Wed, 9 Apr 2008 15:58:24 +0000 Subject: [PATCH] Be conservative if getresult operand is neither call nor invoke. llvm-svn: 49430 --- llvm/lib/Transforms/Scalar/SCCP.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Transforms/Scalar/SCCP.cpp b/llvm/lib/Transforms/Scalar/SCCP.cpp index 0fd931634749..ec2d368d72c0 100644 --- a/llvm/lib/Transforms/Scalar/SCCP.cpp +++ b/llvm/lib/Transforms/Scalar/SCCP.cpp @@ -690,12 +690,13 @@ void SCCPSolver::visitGetResultInst(GetResultInst &GRI) { unsigned Idx = GRI.getIndex(); Value *Aggr = GRI.getOperand(0); Function *F = NULL; - if (CallInst *CI = dyn_cast(Aggr)) + if (CallInst *CI = dyn_cast(Aggr)) F = CI->getCalledFunction(); else if (InvokeInst *II = dyn_cast(Aggr)) F = II->getCalledFunction(); - assert (F && "Invalid GetResultInst operands!"); + if (!F) + return; std::multimap::iterator It, E; tie(It, E) = TrackedMultipleRetVals.equal_range(F);