[clang] [clang][analyzer] Fix a nullptr dereference when -ftime-trace is used (Reland) (PR #139980)
Fangyi Zhou via cfe-commits
cfe-commits at lists.llvm.org
Thu May 15 01:24:06 PDT 2025
fangyi-zhou wrote:
> I think this would still trip on the same memory issue. The problem to me is that we read uninitialized memory. So even if you limit the bounds of the result of the read of such uninitialized memory, it would only mask and limit the effect of such read. Have you tried running the failing case via valgrind? That's usually great for catching uninitialized reads. msan is also great, but that needs an instrumented standard library which may be tough to set up.
I don't think so. I have an asan build locally and it worked.
The methods `getParent()` and `getIndexInBlock()` in CFGElementRef does not access memory, since they only return the value from the ref. The actual dereference happens in `->` operator, which is gated after the newly added `if` condition.
https://github.com/llvm/llvm-project/pull/139980
More information about the cfe-commits
mailing list