[clang] [analyzer] Harden security.cert.env.InvalidPtr checker fn matching (PR #88536)
Ilya A. Kriveshko via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 16 10:58:01 PDT 2024
================
@@ -205,8 +210,12 @@ void InvalidPtrChecker::postPreviousReturnInvalidatingCall(
CE, LCtx, CE->getType(), C.blockCount());
State = State->BindExpr(CE, LCtx, RetVal);
+ const auto *SymRegOfRetVal =
+ dyn_cast_or_null<SymbolicRegion>(RetVal.getAsRegion());
+ if (!SymRegOfRetVal)
+ return;
+
// Remember to this region.
- const auto *SymRegOfRetVal = cast<SymbolicRegion>(RetVal.getAsRegion());
const MemRegion *MR = SymRegOfRetVal->getBaseRegion();
----------------
iillyyaa wrote:
And, again, thank you for such a quick turnaround. Just the availability of this patch has unblocked our development.
https://github.com/llvm/llvm-project/pull/88536
More information about the cfe-commits
mailing list