3 Commits

Author SHA1 Message Date
Fangyi Zhou
81d48e0f61
[clang][analyzer] Fix a nullptr dereference when -ftime-trace is used (Reland) (#139980)
Fixes #139779.

The bug was introduced in #137355 in `SymbolConjured::getStmt`, when
trying to obtain a statement for a CFG initializer without an
initializer.  This commit adds a null check before access.

Previous PR #139820, Revert #139936

Additional notes since previous PR:

When conjuring a symbol, sometimes there is no valid CFG element, e.g.
in the file causing the crash, there is no element at all in the CFG. In
these cases, the CFG element reference in the expression engine will be
invalid. As a consequence, there needs to be extra checks to ensure the
validity of the CFG element reference.
2025-05-15 19:29:58 +02:00
Fangyi Zhou
baf2cfa299
Revert "[clang][analyzer] Fix a nullptr dereference when -ftime-trace is used" (#139936)
Reverts llvm/llvm-project#139820

Reverting due to buildbot failures in asan
2025-05-14 13:45:05 -04:00
Fangyi Zhou
440e510b89
[clang][analyzer] Fix a nullptr dereference when -ftime-trace is used (#139820)
Fixes #139779.

The bug was introduced in #137355 in `SymbolConjured::getStmt`, when
trying to obtain a statement for a CFG initializer without an
initializer. This commit adds a null check before access.
2025-05-14 16:35:57 +02:00