[clang] [WebKit checkers] Treat an implicit value initialization as trivial (PR #126203)

2025-02-07 Thread David Kilzer via cfe-commits
@@ -368,6 +368,11 @@ class RefCounted { } RefPtr trivial66() { return children[0]; } Ref trivial67() { return *children[0]; } + struct point { +double x; +double y; + }; + void trivial68() { point pt = { 1.0 }; } ddkilzer wrote: Not sure how m

[clang] [analyzer] Add alpha.cplusplus.BoundsInformation checker (PR #112784)

2024-10-22 Thread David Kilzer via cfe-commits
ddkilzer wrote: Thanks for the feedback! I will work on updates this week (around the WebKit Contributors meeting, which happens to be the same week as the LLVM Developer's Meeting). In the meantime, the checker (using the original PR) has already found some `std::span` anti-patterns in WebK

[clang] [analyzer] Add alpha.cplusplus.BoundsInformation checker (PR #112784)

2024-10-17 Thread David Kilzer via cfe-commits
ddkilzer wrote: This checker is intended to be a companion to [C++ Safe Buffers](https://clang.llvm.org/docs/SafeBuffers.html) and [`-Wunsafe-buffer-usage`](https://clang.llvm.org/docs/DiagnosticsReference.html#wunsafe-buffer-usage), but not replace it. https://github.com/llvm/llvm-project/p

[clang] [analyzer] Add alpha.cplusplus.BoundsInformation checker (PR #112784)

2024-10-17 Thread David Kilzer via cfe-commits
https://github.com/ddkilzer created https://github.com/llvm/llvm-project/pull/112784 Initial version of a bounds information checker to warn when the two-argument std::span constructor has a suspicious-looking size. >From 1da038a09f7979b4ad5b0843dc4e87b2b450fcfc Mon Sep 17 00:00:00 2001 From:

Re: [PATCH] D17511: [analyzer] Make ObjCDeallocChecker path sensitive.

2016-02-25 Thread David Kilzer via cfe-commits
ddkilzer added inline comments. Comment at: lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp:804 @@ +803,3 @@ +/// Returns true if there is a call to -dealloc anywhere on the stack and false +/// otherwise. If true, it also sets \param SelfValOut to the value of +/// 'self' in the

Re: [PATCH] D17511: [analyzer] Make ObjCDeallocChecker path sensitive.

2016-02-25 Thread David Kilzer via cfe-commits
ddkilzer added inline comments. Comment at: lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp:804 @@ +803,3 @@ +/// Returns true if there is a call to -dealloc anywhere on the stack and false +/// otherwise. If true, it also sets \param SelfValOut to the value of +/// 'self' in the