[clang-tools-extra] [NFC] Fix potential nullptr dereference. (PR #138283)

2025-05-02 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam closed https://github.com/llvm/llvm-project/pull/138283 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [NFC] Fix potential nullptr dereference. (PR #138283)

2025-05-02 Thread Zahira Ammarguellat via cfe-commits
zahiraam wrote: Thanks for your input. I will close this PR. https://github.com/llvm/llvm-project/pull/138283 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [NFC] Fix potential nullptr dereference. (PR #138283)

2025-05-02 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: > But it might not be a `UnaryOperator`, no? `unaryOperator(...).bind("op")` implies `op` will always be a `UnaryOperator`. https://github.com/llvm/llvm-project/pull/138283 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:

[clang-tools-extra] [NFC] Fix potential nullptr dereference. (PR #138283)

2025-05-02 Thread Baranov Victor via cfe-commits
vbvictor wrote: I don't have a strong opinion on this, but this `assert` may be a sign of "false safety". In release builds, it's a no-op, so end users will experience a regular Segfault, e.g. like this issue https://github.com/llvm/llvm-project/issues/135665. Debug builds with asserts are usu

[clang-tools-extra] [NFC] Fix potential nullptr dereference. (PR #138283)

2025-05-02 Thread Zahira Ammarguellat via cfe-commits
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%

[clang-tools-extra] [NFC] Fix potential nullptr dereference. (PR #138283)

2025-05-02 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank requested changes to this pull request. 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

[clang-tools-extra] [NFC] Fix potential nullptr dereference. (PR #138283)

2025-05-02 Thread Zahira Ammarguellat via cfe-commits
zahiraam wrote: > Did you run code sanitizer over all clang-tidy code or you only interested in > this particular file? I think there are many more places where such `nullptr` > dereference can happen, e.g. > > https://github.com/llvm/llvm-project/blob/52d2b589b2d7adc3e2b4ea503df4131e088de61f/

[clang-tools-extra] [NFC] Fix potential nullptr dereference. (PR #138283)

2025-05-02 Thread Baranov Victor via cfe-commits
vbvictor wrote: Did you run code sanitizer over all clang-tidy code or you only interested in this particular file? I think there are many more places where such `nullptr` dereference can happen, e.g. https://github.com/llvm/llvm-project/blob/52d2b589b2d7adc3e2b4ea503df4131e088de61f/clang-tools

[clang-tools-extra] [NFC] Fix potential nullptr dereference. (PR #138283)

2025-05-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tidy Author: Zahira Ammarguellat (zahiraam) Changes A `nullptr` dereference is detected by the code sanitizer. Adding an assert to make sure it's caught. --- Full diff: https://github.com/llvm/llvm-project/pull/138283.diff 1 Files Affected: -

[clang-tools-extra] [NFC] Fix potential nullptr dereference. (PR #138283)

2025-05-02 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam ready_for_review https://github.com/llvm/llvm-project/pull/138283 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [NFC] Fix potential nullptr dereference. (PR #138283)

2025-05-02 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam edited https://github.com/llvm/llvm-project/pull/138283 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [NFC] Fix potential nullptr dereference. (PR #138283)

2025-05-02 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam created https://github.com/llvm/llvm-project/pull/138283 A `nullptr` dereference is signaled by the code sanitizer. Adding an assert to make sure it's caught. Rate limit ยท GitHub body { background-color: #f6f8fa;