[PGOInstrumentation] populateEHOperandBundle - earlyout if !isa<CallBase>

All paths (that actually do anything) require a successful dyn_cast<CallBase> - so just earlyout if the cast fails

Fixes static analyzer nullptr deference warning
This commit is contained in:
Simon Pilgrim 2022-01-10 15:34:24 +00:00
parent 353484d191
commit c1f1359882
1 changed files with 4 additions and 1 deletions

View File

@ -877,7 +877,10 @@ populateEHOperandBundle(VPCandidateInfo &Cand,
DenseMap<BasicBlock *, ColorVector> &BlockColors,
SmallVectorImpl<OperandBundleDef> &OpBundles) {
auto *OrigCall = dyn_cast<CallBase>(Cand.AnnotatedInst);
if (OrigCall && !isa<IntrinsicInst>(OrigCall)) {
if (!OrigCall)
return;
if (!isa<IntrinsicInst>(OrigCall)) {
// The instrumentation call should belong to the same funclet as a
// non-intrinsic call, so just copy the operand bundle, if any exists.
Optional<OperandBundleUse> ParentFunclet =