diff --git a/llvm/lib/CodeGen/WinEHPrepare.cpp b/llvm/lib/CodeGen/WinEHPrepare.cpp --- a/llvm/lib/CodeGen/WinEHPrepare.cpp +++ b/llvm/lib/CodeGen/WinEHPrepare.cpp @@ -251,6 +251,7 @@ State = EHInfo.CxxUnwindMap[State].ToState; // Retrive next State } else if (isa(TI)) { auto *Call = dyn_cast(TI); + assert(Call); const Function *Fn = Call->getCalledFunction(); if (Fn && Fn->isIntrinsic() && (Fn->getIntrinsicID() == Intrinsic::seh_scope_begin || @@ -319,6 +320,7 @@ State = EHInfo.SEHUnwindMap[State].ToState; // Retrive next State } else if (isa(TI)) { auto *Call = dyn_cast(TI); + assert(Call); const Function *Fn = Call->getCalledFunction(); if (Fn && Fn->isIntrinsic() && Fn->getIntrinsicID() == Intrinsic::seh_try_begin)