[PATCH] D69318: [analyzer] Add SufficientSizeArrayIndexingChecker

2020-07-17 Thread Endre Fülöp via Phabricator via cfe-commits
gamesh411 added inline comments. Comment at: clang/test/Analysis/sufficient-size-array-indexing-32bit.c:120 + +void test_symbolic_index_handling4(int choice) { + char c; balazske wrote: > Here "is a chance that indexing is correct". So no warning should occur? I

[PATCH] D69318: [analyzer] Add SufficientSizeArrayIndexingChecker

2020-07-17 Thread Endre Fülöp via Phabricator via cfe-commits
gamesh411 updated this revision to Diff 278727. gamesh411 marked 3 inline comments as done. gamesh411 added a comment. extend test cases add comments to non-obvious cases Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69318/new/ https://reviews.llvm

[PATCH] D69318: [analyzer] Add SufficientSizeArrayIndexingChecker

2020-07-17 Thread Endre Fülöp via Phabricator via cfe-commits
gamesh411 updated this revision to Diff 278703. gamesh411 added a comment. move tests to one file Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69318/new/ https://reviews.llvm.org/D69318 Files: clang/include/clang/StaticAnalyzer/Checkers/Checker

[PATCH] D69318: [analyzer] Add SufficientSizeArrayIndexingChecker

2020-07-17 Thread Endre Fülöp via Phabricator via cfe-commits
gamesh411 marked 4 inline comments as done. gamesh411 added a comment. I am now experimenting with the suggestions. The other issues are on the worklist. Thanks for these so far. Comment at: clang/lib/StaticAnalyzer/Checkers/SufficientSizeArrayIndexingChecker.cpp:50 + if (is

[PATCH] D69318: [analyzer] Add SufficientSizeArrayIndexingChecker

2020-07-09 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SufficientSizeArrayIndexingChecker.cpp:27 +: public Checker> { + mutable std::unique_ptr BT; + gamesh411 wrote: > balazske wrote: > > The bug type can be initialized here: > > `BT

[PATCH] D69318: [analyzer] Add SufficientSizeArrayIndexingChecker

2020-07-08 Thread Endre Fülöp via Phabricator via cfe-commits
gamesh411 updated this revision to Diff 276346. gamesh411 added a comment. apply review suggestions Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69318/new/ https://reviews.llvm.org/D69318 Files: clang/include/clang/StaticAnalyzer/Checkers/Check

[PATCH] D69318: [analyzer] Add SufficientSizeArrayIndexingChecker

2020-07-08 Thread Endre Fülöp via Phabricator via cfe-commits
gamesh411 marked 7 inline comments as done. gamesh411 added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SufficientSizeArrayIndexingChecker.cpp:27 +: public Checker> { + mutable std::unique_ptr BT; + balazske wrote: > The bug type can be i

[PATCH] D69318: [analyzer] Add SufficientSizeArrayIndexingChecker

2020-07-07 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SufficientSizeArrayIndexingChecker.cpp:27 +: public Checker> { + mutable std::unique_ptr BT; + The bug type can be initialized here: `BT{this, "...", "..."}` How did this compile

[PATCH] D69318: [analyzer] Add SufficientSizeArrayIndexingChecker

2020-07-07 Thread Endre Fülöp via Phabricator via cfe-commits
gamesh411 added a comment. The checker has been updated, the comments and the logic polished. I would still take a stab at this being a ClangSa checker (as opposed to being a Tidy check). What do you think? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm

[PATCH] D69318: [analyzer] Add SufficientSizeArrayIndexingChecker

2020-07-07 Thread Endre Fülöp via Phabricator via cfe-commits
gamesh411 marked 8 inline comments as done. gamesh411 added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SufficientSizeArrayIndexingChecker.cpp:42 +BugType & +SufficientSizeArrayIndexingChecker::GetBugTypeForType(const QualType T) const { + auto BT = BugTypeCa

[PATCH] D69318: [analyzer] Add SufficientSizeArrayIndexingChecker

2020-07-07 Thread Endre Fülöp via Phabricator via cfe-commits
gamesh411 marked 4 inline comments as done. gamesh411 added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Checkers/Checkers.td:622 + } // end: "alpha.cplusplus" NoQ wrote: > What makes this checker C++-specific? All your tests are in plain C.

[PATCH] D69318: [analyzer] Add SufficientSizeArrayIndexingChecker

2020-07-07 Thread Endre Fülöp via Phabricator via cfe-commits
gamesh411 updated this revision to Diff 275938. gamesh411 added a comment. fix detection logic fix license header add missing warning to test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69318/new/ https://reviews.llvm.org/D69318 Files: clang/i

[PATCH] D69318: [analyzer] Add SufficientSizeArrayIndexingChecker

2020-07-06 Thread Endre Fülöp via Phabricator via cfe-commits
gamesh411 updated this revision to Diff 275678. gamesh411 added a comment. modernize the memory modeling code, still WIP Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69318/new/ https://reviews.llvm.org/D69318 Files: clang/include/clang/StaticAn

[PATCH] D69318: [analyzer] Add SufficientSizeArrayIndexingChecker

2020-07-06 Thread Endre Fülöp via Phabricator via cfe-commits
gamesh411 updated this revision to Diff 275625. gamesh411 added a comment. make single bug-type fix checker registration Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69318/new/ https://reviews.llvm.org/D69318 Files: clang/include/clang/StaticAn

[PATCH] D69318: [analyzer] Add SufficientSizeArrayIndexingChecker

2020-07-06 Thread Endre Fülöp via Phabricator via cfe-commits
gamesh411 updated this revision to Diff 275611. gamesh411 added a comment. move to core.alpha Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69318/new/ https://reviews.llvm.org/D69318 Files: clang/include/clang/StaticAnalyzer/Checkers/Checkers.td

[PATCH] D69318: [analyzer] Add SufficientSizeArrayIndexingChecker

2020-07-06 Thread Endre Fülöp via Phabricator via cfe-commits
gamesh411 updated this revision to Diff 275605. gamesh411 added a comment. Herald added subscribers: ASDenysPetrov, martong. change license Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69318/new/ https://reviews.llvm.org/D69318 Files: clang/inc

[PATCH] D69318: [analyzer] Add SufficientSizeArrayIndexingChecker

2019-10-30 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SufficientSizeArrayIndexingChecker.cpp:75 + // Should not warn on literal index expressions. + if (dyn_cast(Index->IgnoreParenCasts())) +return; Shoudn't we use `isa<>` if we don

[PATCH] D69318: [analyzer] Add SufficientSizeArrayIndexingChecker

2019-10-29 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SufficientSizeArrayIndexingChecker.cpp:42 +BugType & +SufficientSizeArrayIndexingChecker::GetBugTypeForType(const QualType T) const { + auto BT = BugTypeCache.find(T); The whole point of b

[PATCH] D69318: [analyzer] Add SufficientSizeArrayIndexingChecker

2019-10-29 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. I suspect that with this check by choosing path-sensitivity you gain less than you lose. That is, checking how the array pointer is passed around may be nice, but if you sacrificed that, you could have turned this check into a compiler warning which would have had an effect

[PATCH] D69318: [analyzer] Add SufficientSizeArrayIndexingChecker

2019-10-22 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added reviewers: baloghadamsoftware, xazax.hun, rnkovacs, Charusso, dcoughlin. Szelethus added a comment. In D69318#1718220 , @gamesh411 wrote: > Please feel free to add more reviewers. Here you go! Repository: rG LLVM Github Monorepo CHA

[PATCH] D69318: [analyzer] Add SufficientSizeArrayIndexingChecker

2019-10-22 Thread Endre Fülöp via Phabricator via cfe-commits
gamesh411 created this revision. Herald added subscribers: cfe-commits, Charusso, dkrupp, donat.nagy, Szelethus, arphaman, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun, whisperity, mgorny. Herald added a project: clang. gamesh411 added a reviewer: Szelethus. gamesh411 added a

[PATCH] D69318: [analyzer] Add SufficientSizeArrayIndexingChecker

2019-10-22 Thread Endre Fülöp via Phabricator via cfe-commits
gamesh411 added a comment. Please feel free to add more reviewers. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69318/new/ https://reviews.llvm.org/D69318 ___ cfe-commits mailing list cfe-commits@list