[clang] [analyzer] Use AllocaRegion in MallocChecker (PR #72402)

Artem Dergachev via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 15 13:07:10 PST 2023


haoNoQ wrote:

Hmm, it really worries me that `MallocChecker` is setting a return value outside of `evalCall()`. This can easily lead to conflicts if multiple checkers try to do this: `evalCall()` is protected from conflicts (the engine asserts that at most one checker evaluates each call) but `checkPostCall()` isn't.

To the best of my knowledge, the only legal way to use `State->BindExpr(...)` in a checker is to set the return value in `evalCall()`. Ideally we should have an assertion about this ("Environment is unchanged after checker callback invocation, unless the callback is a successful `evalCall()`").

https://github.com/llvm/llvm-project/pull/72402


More information about the cfe-commits mailing list