[clang-tools-extra] [NFC] Fix potential nullptr dereference. (PR #138283)
Zahira Ammarguellat via cfe-commits
cfe-commits at lists.llvm.org
Fri May 2 10:16:18 PDT 2025
zahiraam wrote:
> This is not needed IMO. This is a simple matcher, `op` is expected to always be bound.
>
> One might say that it can't hurt to add extra checks, but I don't think that's good justification for adding more code / bloat, even if in this case it's a single line. Still, 5% more code for this check counting non-empty non-comment lines!
>
> Happy to disagree if any of the maintainers think otherwise.
The sanitizer is complaining about the possibility of having `Operator` be null. `op` might always be bound. But it might not be a `UnaryOperator`, no?
https://github.com/llvm/llvm-project/pull/138283
More information about the cfe-commits
mailing list