[clang] [analyzer] Fix null-pointer dereference in PthreadLockChecker (PR #210912)

Arseniy Zaostrovnykh via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 21 08:12:08 PDT 2026


necto wrote:

> Why does the language affect the outcome of the test?

the difference comes from the `if (global_var >> 48 & (1ULL << 8) - 1 & 8)`. in C it is treated as an `SVal` and passed directly to `assume`. in C++ there is an implicit cast to `bool`, which triggers `svalBuilder.simplifySVal` call in ExprEngine, at which point it gets simplified to `0`, so the infeasible path never occurs.

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


More information about the cfe-commits mailing list