[clang] [analyzer] Switch to PostStmt callbacks in ArrayBoundV2 (PR #72107)

via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 30 05:39:31 PST 2023


=?utf-8?q?Donát?= Nagy <donat.nagy at ericsson.com>,
=?utf-8?q?Donát?= Nagy <donat.nagy at ericsson.com>,
=?utf-8?q?Donát?= Nagy <donat.nagy at ericsson.com>,
=?utf-8?q?Donát?= Nagy <donat.nagy at ericsson.com>,
=?utf-8?q?Donát?= Nagy <donat.nagy at ericsson.com>,
=?utf-8?q?Donát?= Nagy <donat.nagy at ericsson.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/72107 at github.com>


DonatNagyE wrote:

@Xazax-hun I added a few testcases that show the current behavior of the checker w.r.t. invalid references. I think this is reasonably correct behavior, but I'm not too interested in the legality of these gray areas and I don't have strong opinions.

By the way, with the new `PostStmt` callbacks, "the result is assigned to a reference" is no longer a corner case. Perhaps it had a strange behavior with the old `Location` callback (because it performs an implicit address-of in some sense), but after this commit ArrayBoundV2 only looks for the syntactic presence of a (non-overloaded) subscript operator.

https://github.com/llvm/llvm-project/pull/72107


More information about the cfe-commits mailing list