[PATCH] D79072: [Analyzer][VLASizeChecker] Check VLA size in typedef and sizeof.

2020-05-14 Thread Balázs Kéri via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGcb1eeb42c03c: [Analyzer][VLASizeChecker] Check VLA size in typedef and sizeof. (authored by balazske). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D79072: [Analyzer][VLASizeChecker] Check VLA size in typedef and sizeof.

2020-05-13 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. Herald added a subscriber: rnkovacs. In D79072#2026553 , @balazske wrote: > This change is relatively small and the refactoring like part (introduction > of `checkVLA` if I think correct?) is

[PATCH] D79072: [Analyzer][VLASizeChecker] Check VLA size in typedef and sizeof.

2020-05-13 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus accepted this revision. Szelethus added a comment. This revision is now accepted and ready to land. In D79072#2025120 , @martong wrote: > I'd split this patch into two as well. > > 1. [NFC] Refactoring parts > 2. The actual extra additions about

[PATCH] D79072: [Analyzer][VLASizeChecker] Check VLA size in typedef and sizeof.

2020-05-08 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. This change is relatively small and the refactoring like part (introduction of `checkVLA` if I think correct?) is connected to its use. The other change is add of a new function (callback). This is probably small enough to go into one change and we can see why the new

[PATCH] D79072: [Analyzer][VLASizeChecker] Check VLA size in typedef and sizeof.

2020-05-07 Thread Balázs Kéri via Phabricator via cfe-commits
balazske marked 3 inline comments as done. balazske added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp:577 + if (isa(*DS->decl_begin())) { +ExplodedNodeSet DstPre; +getCheckerManager().runCheckersForPreStmt(DstPre, Pred, DS, *this);

[PATCH] D79072: [Analyzer][VLASizeChecker] Check VLA size in typedef and sizeof.

2020-05-07 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. I'd split this patch into two as well. 1. [NFC] Refactoring parts 2. The actual extra additions about sizeof and typedef. WDYT? Other than that looks good. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79072/new/

[PATCH] D79072: [Analyzer][VLASizeChecker] Check VLA size in typedef and sizeof.

2020-05-07 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 262661. balazske marked 2 inline comments as done. balazske added a comment. Added better comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79072/new/ https://reviews.llvm.org/D79072 Files:

[PATCH] D79072: [Analyzer][VLASizeChecker] Check VLA size in typedef and sizeof.

2020-05-07 Thread Balázs Kéri via Phabricator via cfe-commits
balazske marked 4 inline comments as done. balazske added a comment. I do not know what other than `typedef` or `sizeof` (and variable declaration) can contain VLA. To my knowledge VLA is not normally supported in C++ and should not be used anyway (there are better ways for doing it) so some

[PATCH] D79072: [Analyzer][VLASizeChecker] Check VLA size in typedef and sizeof.

2020-05-07 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. We check now whether the argument of `typedef` and `sizeof` is an incorrect VLA, but what other examples are we potentially forgetting? The warning message states that "Declared variable-length array (VLA) has negative size", but we are not actually looking for

[PATCH] D79072: [Analyzer][VLASizeChecker] Check VLA size in typedef and sizeof.

2020-04-29 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Overall the changes look good to me here. I had a small nit inline. But I wonder if we actually should add more code in the analyzer core to better model the sizes of memory regions corresponding to the VLAs. Comment at:

[PATCH] D79072: [Analyzer][VLASizeChecker] Check VLA size in typedef and sizeof.

2020-04-29 Thread Balázs Kéri via Phabricator via cfe-commits
balazske created this revision. Herald added subscribers: cfe-commits, ASDenysPetrov, martong, Charusso, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: Szelethus. Herald added a project: clang. The check of