[PATCH] D69726: [analyzer] DynamicSize: Store the dynamic size

2021-04-07 Thread Csaba Dabis via Phabricator via cfe-commits
Charusso added a comment. Thank you guys for investigating it! In D69726#2671734 , @vsavchenko wrote: > 2. The analyzer doesn't explain why it thinks that `guc_malloc` returns null > pointer. I find it alarming that it might assume it for all the wrong

[PATCH] D69726: [analyzer] DynamicSize: Store the dynamic size

2021-04-06 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. Here's a reduced repro - a file that has different behavior before and after the patch (sorry, not perfectly reduced, my creduce is broken again): // RUN: clang --analyze %s typedef Oid; typedef Pointer; typedef text; errstart(int elevel, filename, lineno, funcname

[PATCH] D69726: [analyzer] DynamicSize: Store the dynamic size

2021-04-06 Thread Valeriy Savchenko via Phabricator via cfe-commits
vsavchenko added a comment. In D69726#2671611 , @Charusso wrote: > In D69726#2671526 , @vsavchenko > wrote: > >> @Charusso >> It looks like this patch introduced a some weird false positive on >> PostgreSQL F1616

[PATCH] D69726: [analyzer] DynamicSize: Store the dynamic size

2021-04-06 Thread Csaba Dabis via Phabricator via cfe-commits
Charusso added a comment. In D69726#2671526 , @vsavchenko wrote: > @Charusso > It looks like this patch introduced a some weird false positive on PostgreSQL > F16161734: report-guc.c-ParseLongOption-13-1.html > > I'l

[PATCH] D69726: [analyzer] DynamicSize: Store the dynamic size

2021-04-06 Thread Valeriy Savchenko via Phabricator via cfe-commits
vsavchenko added a comment. @Charusso It looks like this patch introduced a some weird false positive on PostgreSQL F16161734: report-guc.c-ParseLongOption-13-1.html I'll try to look at it myself and minimize it, but maybe you can get an idea from a full re

[PATCH] D69726: [analyzer] DynamicSize: Store the dynamic size

2021-04-05 Thread Csaba Dabis via Phabricator via cfe-commits
Charusso added a comment. Cool, thanks! Debug facility NFC: https://reviews.llvm.org/rG89d210fe1a7a1c6cbf926df0595b6f107bc491d5 `size` -> `extent` conversion: https://reviews.llvm.org/rG9b3df78b4c2ab7a7063e532165492e1ffa38d401 Comment at: clang/lib/StaticAnalyzer/Checkers/Ex

[PATCH] D69726: [analyzer] DynamicSize: Store the dynamic size

2021-04-05 Thread Csaba Dabis via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Charusso marked an inline comment as done. Closed by commit rGdf64f471d1e2: [analyzer] DynamicSize: Store the dynamic size (authored by Charusso). Changed prior to commit: https://reviews.llvm.org/D69726?vs=319940&id=3352

[PATCH] D69726: [analyzer] DynamicSize: Store the dynamic size

2021-04-01 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ accepted this revision. NoQ added a comment. This revision is now accepted and ready to land. I don't see any further bugs so I think this is good to go! I think you should separate out the NFC / debugging facility changes before committing. Comment at: clang/lib/StaticAn

[PATCH] D69726: [analyzer] DynamicSize: Store the dynamic size

2021-03-16 Thread Csaba Dabis via Phabricator via cfe-commits
Charusso added a comment. @NoQ, could you upstream it and move this idea forward please? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69726/new/ https://reviews.llvm.org/D69726 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://

[PATCH] D69726: [analyzer] DynamicSize: Store the dynamic size

2021-01-28 Thread Csaba Dabis via Phabricator via cfe-commits
Charusso added a reviewer: vsavchenko. Charusso added a comment. Hey, I am back. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/DynamicSize.h:41-44 +/// Set the dynamic size of a CXXNewExpr \p NE by its region \p MR. +ProgramStateRef setDynamicSize(ProgramSt

[PATCH] D69726: [analyzer] DynamicSize: Store the dynamic size

2021-01-28 Thread Csaba Dabis via Phabricator via cfe-commits
Charusso updated this revision to Diff 319940. Charusso marked 6 inline comments as done. Charusso added a comment. - Fix everything. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69726/new/ https://reviews.llvm.org/D69726 Files: clang/docs/analyzer/developer-docs/DebugChecks.rst c

[PATCH] D69726: [analyzer] DynamicSize: Store the dynamic size

2021-01-21 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D69726#2471657 , @vabridgers wrote: > I was referred to this patch from https://reviews.llvm.org/D86743. I pulled > this patch under review, brought it up to date and pushed to github at > https://github.com/vabridgers/llvm-pr

[PATCH] D69726: [analyzer] DynamicSize: Store the dynamic size

2020-12-25 Thread Vince Bridgers via Phabricator via cfe-commits
vabridgers added subscribers: balazske, vabridgers. vabridgers added a comment. I was referred to this patch from https://reviews.llvm.org/D86743. I pulled this patch under review, brought it up to date and pushed to github at https://github.com/vabridgers/llvm-project-dev.git, branch: vla-fam-f

[PATCH] D69726: [analyzer] DynamicSize: Store the dynamic size

2020-09-30 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. Thank you for reminding me of this patch. I still think it's a pretty important patch and i'm interested in getting it landed. Comment at: clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp:1388 - ->castAs() - ->StripCasts(

[PATCH] D69726: [analyzer] DynamicSize: Store the dynamic size

2020-07-15 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. While this patch spans across a lot of files, it is actually rather straightforward. I'm stunned to see that we never really had a proper dynamic size support, especially that this patch has been out there for a good long time :) Oh well, better learn that now than ne

[PATCH] D69726: [analyzer] DynamicSize: Store the dynamic size

2020-03-31 Thread Csaba Dabis via Phabricator via cfe-commits
Charusso updated this revision to Diff 254051. Charusso added a comment. - Remove the last gymnastic. - Rebase. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69726/new/ https://reviews.llvm.org/D69726 Files: clang/docs/analyzer/developer-docs/DebugChecks.rst clang/include/clang/Sta

[PATCH] D69726: [analyzer] DynamicSize: Store the dynamic size

2020-03-28 Thread Csaba Dabis via Phabricator via cfe-commits
Charusso updated this revision to Diff 253394. Charusso marked 19 inline comments as done. Charusso edited the summary of this revision. Charusso added a comment. Herald added a subscriber: ASDenysPetrov. - Fix `VLASizeChecker`'s multi-dimensional array early return. - So that fix the regression i

[PATCH] D69726: [analyzer] DynamicSize: Store the dynamic size

2020-03-28 Thread Csaba Dabis via Phabricator via cfe-commits
Charusso added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/DynamicSize.h:25 -/// Get the stored dynamic size for the region \p MR. +/// \returns The stored dynamic size for the region \p MR. DefinedOrUnknownSVal getDynamicSize(ProgramSta

[PATCH] D69726: [analyzer] DynamicSize: Store the dynamic size

2020-03-15 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/DynamicSize.h:25 -/// Get the stored dynamic size for the region \p MR. +/// \returns The stored dynamic size for the region \p MR. DefinedOrUnknownSVal getDynamicSize(ProgramStateRef

[PATCH] D69726: [analyzer] DynamicSize: Store the dynamic size

2020-03-03 Thread Csaba Dabis via Phabricator via cfe-commits
Charusso updated this revision to Diff 248097. Charusso marked 4 inline comments as done. Charusso edited the summary of this revision. Charusso added a comment. - Set the size properly. - Add new debug.ExprInspection patterns: region, size, element count. - `clang-format -i ExprInspectionChecker.

[PATCH] D69726: [analyzer] DynamicSize: Store the dynamic size

2020-03-03 Thread Csaba Dabis via Phabricator via cfe-commits
Charusso marked 2 inline comments as done. Charusso added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/DynamicSize.cpp:85 +if (CI->getValue().isUnsigned()) + Size = SVB.makeIntVal(CI->getValue(), /*IsUnsigned=*/false); + That one is interes

[PATCH] D69726: [analyzer] DynamicSize: Store the dynamic size

2020-02-20 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. Herald added subscribers: martong, steakhal. Hmm, has this patch not landed yet? I was so excited to finally have https://bugs.llvm.org/show_bug.cgi?id=28450 fixed :) Comment at: clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp:767 + DefinedOrUnknownSV

[PATCH] D69726: [analyzer] DynamicSize: Store the dynamic size

2020-01-31 Thread Csaba Dabis via Phabricator via cfe-commits
Charusso updated this revision to Diff 241749. Charusso edited the summary of this revision. Charusso added a comment. - Let us reuse this patch. - Remove the expression storing feature. - Only store known sizes. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69726/new/ https://reviews.l

[PATCH] D69726: [analyzer] DynamicSize: Store the dynamic size

2020-01-30 Thread Csaba Dabis via Phabricator via cfe-commits
Charusso abandoned this revision. Charusso marked an inline comment as done. Charusso added a comment. Let us say, we do not need this patch. In case we would need it, I will reopen. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69726/new/ https://reviews.llvm.org/D69726

[PATCH] D69726: [analyzer] DynamicSize: Store the dynamic size

2019-11-04 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/DynamicSize.h:29-31 +/// \returns The stored dynamic size expression for the region \p MR. +const Expr *getDynamicSizeExpr(ProgramStateRef State, const MemRegion *MR); +

[PATCH] D69726: [analyzer] DynamicSize: Store the dynamic size

2019-11-04 Thread Csaba Dabis via Phabricator via cfe-commits
Charusso marked 3 inline comments as done. Charusso added a comment. In D69726#1732334 , @Szelethus wrote: > Changes to `MallocChecker` really highlight the positive effects of this > patch. Nice! Thanks! Comment at: clang/lib/Static

[PATCH] D69726: [analyzer] DynamicSize: Store the dynamic size

2019-11-04 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. Changes to `MallocChecker` really highlight the positive effects of this patch. Nice! Comment at: clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp:451 static ProgramStateRef MallocMemAux(CheckerContext &C, const CallExpr *CE, -

[PATCH] D69726: [analyzer] DynamicSize: Store the dynamic size

2019-11-01 Thread Csaba Dabis via Phabricator via cfe-commits
Charusso updated this revision to Diff 227534. Charusso marked 6 inline comments as done. Charusso added a comment. - Fix. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69726/new/ https://reviews.llvm.org/D69726 Files: clang/include/clang/StaticAnalyzer/Core/PathSensitive/DynamicSize

[PATCH] D69726: [analyzer] DynamicSize: Store the dynamic size

2019-11-01 Thread Csaba Dabis via Phabricator via cfe-commits
Charusso added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/DynamicSize.h:29-31 +/// \returns The stored dynamic size expression for the region \p MR. +const Expr *getDynamicSizeExpr(ProgramStateRef State, const MemRegion *MR); + ---

[PATCH] D69726: [analyzer] DynamicSize: Store the dynamic size

2019-11-01 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/DynamicSize.h:29-31 +/// \returns The stored dynamic size expression for the region \p MR. +const Expr *getDynamicSizeExpr(ProgramStateRef State, const MemRegion *MR); +

[PATCH] D69726: [analyzer] DynamicSize: Store the dynamic size

2019-11-01 Thread Csaba Dabis via Phabricator via cfe-commits
Charusso marked an inline comment as done. Charusso added a comment. I do not want to reverse engineer the `MallocChecker` to obtain the size on call basis. The current model without D68725 makes it enough difficult to obtain the size even with this generic map,

[PATCH] D69726: [analyzer] DynamicSize: Store the dynamic size

2019-11-01 Thread Csaba Dabis via Phabricator via cfe-commits
Charusso created this revision. Charusso added a reviewer: NoQ. Charusso added a project: clang. Herald added subscribers: cfe-commits, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. This patch introduces a way to store the symbolic size and its