[PATCH] D62952: [analyzer][tests] Use normalize_sarif in place of diff_sarif

2019-06-06 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a reviewer: aaron.ballman. Szelethus added a comment. Added Aaron as he wrote the this diagnostic output type :) Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62952/new/ https://reviews.llvm.org/D62952 __

[PATCH] D62885: [analyzer] Add werror flag for analyzer warnings

2019-06-07 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus accepted this revision. Szelethus added a comment. Comment at: include/clang/Driver/CC1Options.td:170 +def analyzer_werror : Flag<["-"], "analyzer-werror">, + HelpText<"Emit analyzer results as errors, not warnings">; + how about "rather than warnin

[PATCH] D63080: [analyzer] Track indices of arrays

2019-06-10 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus created this revision. Szelethus added reviewers: NoQ, dcoughlin, xazax.hun, rnkovacs, baloghadamsoftware, Charusso. Szelethus added a project: clang. Herald added subscribers: cfe-commits, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, szepet, whisperity. Observe the test

[PATCH] D63086: [analyzer][NoStoreFuncVisitor][NFC] Move methods out-of-line, turn some to static functions

2019-06-10 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus created this revision. Szelethus added reviewers: NoQ, dcoughlin, xazax.hun, rnkovacs, Charusso, baloghadamsoftware. Szelethus added a project: clang. Herald added subscribers: cfe-commits, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, szepet, whisperity. I personally foun

[PATCH] D62883: [analyzer] Track conditions of terminator statements on which the reported node depends on

2019-06-10 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. I implemented the fixes you commented on, but during evaluation it turned out that my visitor eats ram for breakfast, and then goes for seconds. I mean, like 5-30x the normal memory consumption, and the same for analysis speed. I counted the number of concurrent insta

[PATCH] D62611: [analyzer][Dominators] Add unittests

2019-06-11 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. Ping. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62611/new/ https://reviews.llvm.org/D62611 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D62883: [analyzer] Track conditions of terminator statements on which the reported node depends on

2019-06-13 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus updated this revision to Diff 204554. Szelethus added a comment. - Resolved some reviewer comments - Added a `BugReport` level set to avoid tracking the same condition (which would result in an almost infinite loop) Aaaand I have some results to show: http://cc.elte.hu:15001/Default/#

[PATCH] D62883: [analyzer] Track conditions of terminator statements on which the reported node depends on

2019-06-13 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus marked 6 inline comments as done. Szelethus added inline comments. Comment at: clang/test/Analysis/track-control-dependency-conditions.cpp:34 + + foo(); // TODO: Add nodes here about flag's value being invalidated. + if (flag) // expected-note {{Taking false branch}

[PATCH] D62883: [analyzer] Track conditions of terminator statements on which the reported node depends on

2019-06-13 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. I marked reports, confusingly, "Confirmed" if the extra notes were meaningful, "Intentional" if they were meaningless, and "False positive" if it's in between. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62883/new/ https://reviews.llvm.org/D62883 ___

[PATCH] D62883: [analyzer] Track conditions of terminator statements on which the reported node depends on

2019-06-13 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. I took a look at the results. You can take a look at selected ones here: http://cc.elte.hu:15001/Default/#report-hash=&run=LLVM%2FClang%2FClang-tools-extra%20AFTER%20tracking%20conditions&review-status=Confirmed&review-status=False%20positive&review-status=Intentional&d

[PATCH] D62883: [analyzer] Track conditions of terminator statements on which the reported node depends on

2019-06-14 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. I don't understand why the visibility had to be changed (especially without explanation), and unless there's a strong reason for it, I strongly disagree with it. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62883/new/ https://reviews.llvm.org/D62883

[PATCH] D62883: [analyzer] Track conditions of terminator statements on which the reported node depends on

2019-06-14 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. In D62883#1544283 , @NoQ wrote: > However, this heuristic breaks when the same code appears in an inlined stack > frame. Because given the context, we need to prove that this check makes > sense *in this context*. I strongly su

[PATCH] D62899: [analyzer][UninitializedObjectChecker] Mark uninitialized regions as interesting.

2019-06-14 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. Ping, anything against this? :) Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62899/new/ https://reviews.llvm.org/D62899 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://list

[PATCH] D63080: [analyzer] Track indices of arrays

2019-06-14 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus updated this revision to Diff 204888. Szelethus added a comment. One more test just for good measure, don't enable null fp suppression. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D63080/new/ https://reviews.llvm.org/D63080 Files: clang/lib/StaticAnalyzer/Core/BugReporterV

[PATCH] D62883: [analyzer] Track conditions of terminator statements on which the reported node depends on

2019-06-14 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. In D62883#1542802 , @Szelethus wrote: > If you hover your mouse over the icon, you can also read a comment of mine. > When you open a report, in the right corner of the source code you'll find a > dropdown menu, allowing you to

[PATCH] D63086: [analyzer][NoStoreFuncVisitor][NFC] Move methods out-of-line, turn some to static functions

2019-06-16 Thread Kristóf Umann via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL363509: [analyzer][NFC] Tease apart and clang-format NoStoreFuncVisitor (authored by Szelethus, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to comm

[PATCH] D63080: [analyzer] Track indices of arrays

2019-06-16 Thread Kristóf Umann via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL363510: [analyzer] Track indices of arrays (authored by Szelethus, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.or

[PATCH] D62899: [analyzer][UninitializedObjectChecker] Mark uninitialized regions as interesting.

2019-06-16 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. In D62899#1544630 , @NoQ wrote: > I don't remember what exactly does `markInteresting()` do and these tests > don't really convince me that it does anything at all. Halp? >.< Damnit, forgot my actual test file in the office (d

[PATCH] D62926: [analyzer] ReturnVisitor: Bypass everything to see inlined calls

2019-06-16 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added inline comments. Comment at: cfe/trunk/test/Analysis/inlining/placement-new-fp-suppression.cpp:16 + +typedef unsigned long uintptr_t; + hintonda wrote: > I don't believe this is really ever portable, but definitely not on 64 bit > Windows where a

[PATCH] D62926: [analyzer] ReturnVisitor: Bypass everything to see inlined calls

2019-06-16 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added inline comments. Comment at: cfe/trunk/test/Analysis/inlining/placement-new-fp-suppression.cpp:16 + +typedef unsigned long uintptr_t; + Szelethus wrote: > hintonda wrote: > > I don't believe this is really ever portable, but definitely not on 64 b

[PATCH] D62883: [analyzer] Track conditions of terminator statements on which the reported node depends on

2019-06-16 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus marked an inline comment as done. Szelethus added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:157 + /// Conditions we're already tracking. + llvm::SmallPtrSet TrackedConditions; + xazax.hun wrote: >

[PATCH] D62619: [analyzer][Dominators] Add a control dependency calculator + a new debug checker

2019-06-16 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus updated this revision to Diff 204972. Szelethus retitled this revision from "[analyzer][Dominators] Add a control dependency tree builder + a new debug checker" to "[analyzer][Dominators] Add a control dependency calculator + a new debug checker". Szelethus edited the summary of this re

[PATCH] D62883: [analyzer] Track conditions of terminator statements on which the reported node depends on

2019-06-16 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus updated this revision to Diff 204973. Szelethus added a comment. - Rebase on the rest of the patches - Make `TrackControlDependencyCondBRVisitor` local to `BugReporterVisitors.cpp` - Hide the current implementation behind the off-by-default analyzer config `"track-conditions"` - Add two

[PATCH] D62883: [analyzer] Track conditions of terminator statements on which the reported node depends on

2019-06-16 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus marked 8 inline comments as done. Szelethus added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:1850 + +return const_cast(Node->getLocationContext() +->getAnalysisDeclContext()->getCFGStmtMap()->getBlock(S));

[PATCH] D62883: [analyzer] Track conditions of terminator statements on which the reported node depends on

2019-06-16 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus marked an inline comment as done. Szelethus added a comment. In D62883#1545324 , @Charusso wrote: > Hey! It is a cool patch as the smallest the scope the better to understand > what is going on. I like the direction, but we saw with @NoQ, we hav

[PATCH] D62883: [analyzer] Track conditions of terminator statements on which the reported node depends on

2019-06-16 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus updated this revision to Diff 204980. Szelethus added a comment. Add another `RUN:` line to see more clearly the effects of this patch. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62883/new/ https://reviews.llvm.org/D62883 Files: clang/include/clang/StaticAnalyzer/Core/An

[PATCH] D62883: [analyzer] Track conditions of terminator statements on which the reported node depends on

2019-06-16 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. In D62883#1545343 , @Charusso wrote: > In D62883#1545341 , @Szelethus wrote: > > > In D62883#1545324 , @Charusso > > wrote: > > > > > As @NoQ poin

[PATCH] D62619: [analyzer][IDF] Add a control dependency calculator + a new debug checker

2019-06-17 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus updated this revision to Diff 205109. Szelethus marked 7 inline comments as done. Szelethus added a comment. Fixes according to reviewer comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62619/new/ https://reviews.llvm.org/D62619 Files: clang/include/clang/Analysis/An

[PATCH] D62619: [analyzer][IDF] Add a control dependency calculator + a new debug checker

2019-06-17 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added inline comments. Comment at: clang/include/clang/Analysis/Analyses/Dominators.h:51 + CFGDominatorTreeImpl(CFG *cfg) { +buildDominatorTree(cfg); + } kuhar wrote: > DomTree has a constructor that runs the builder -- why not use it directly? Th

[PATCH] D62883: [analyzer] Track conditions of terminator statements on which the reported node depends on

2019-06-17 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus marked 3 inline comments as done. Szelethus added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:1609-1613 + if (B->rbegin()->getKind() != CFGElement::Kind::Statement) +return nullptr; + + // This should be the condition of the

[PATCH] D62688: [Analyzer] Iterator Checkers - Model `empty()` method of containers

2019-06-18 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. Hmm, an idea just popped into my head. I'm not sure whether we have a single checker that does so much complicated (and totally awesome) modeling as `IteratorChecker`. What do you think about a debug checker similar to `debug.ExprInspection`, like `debug.IteratorInsp

[PATCH] D62688: [Analyzer] Iterator Checkers - Model `empty()` method of containers

2019-06-18 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added inline comments. Comment at: lib/StaticAnalyzer/Checkers/IteratorChecker.cpp:1741-1763 +bool isContainer(const CXXRecordDecl *CRD) { + if (!CRD) +return false; + + for (const auto *Decl : CRD->decls()) { +const auto *TD = dyn_cast(Decl); +if (!TD) --

[PATCH] D62899: [analyzer][UninitializedObjectChecker] Mark uninitialized regions as interesting.

2019-06-18 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus updated this revision to Diff 205511. Szelethus added a comment. Added a proper testfile. The only downside of it, is that it doesn't test anything. Literally nothing would change is I didn't mark the fields interesting. I'll take this back to the drawing board. CHANGES SINCE LAST AC

[PATCH] D63538: [analyzer][CFG] Return the correct terminator condition

2019-06-19 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus created this revision. Szelethus added reviewers: NoQ, xazax.hun, a_sidorin, baloghadamsoftware, rnkovacs, dcoughlin. Szelethus added a project: clang. Herald added subscribers: cfe-commits, Charusso, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, szepet, whisperity. For th

[PATCH] D64635: [CrossTU] Added CTU argument to diagnostic consumer create fn.

2019-07-12 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added reviewers: NoQ, Szelethus. Szelethus accepted this revision. Szelethus added a comment. This revision is now accepted and ready to land. LGTM! Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64635/new/ https://reviews.llvm.org/D64635

[PATCH] D64638: [CrossTU] Fix plist macro expansion if macro in other file.

2019-07-12 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. LGTM! Thanks! Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64638/new/ https://reviews.llvm.org/D64638 ___

[PATCH] D64628: [CrossTU] Test change only: improve ctu-main.c

2019-07-12 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. Hmmm, did this result in an assertion? Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64628/new/ https://reviews.llvm.org/D64628 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https

[PATCH] D64272: [analyzer] Note last writes to a condition only in a nested stackframe

2019-07-14 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. Gentle ping. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64272/new/ https://reviews.llvm.org/D64272 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[PATCH] D64287: [analyzer] Track the right hand side of the last store regardless of its value

2019-07-14 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus marked 2 inline comments as done. Szelethus added a comment. Would you say it's good to go? :) Comment at: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:1436-1437 -} -ReturnVisitor::addVisitorIfNecessary(StoreSite, InitE->IgnoreParenCasts(), -

[PATCH] D64232: [analyzer] Prune calls to functions with linear CFGs that return a non-zero constrained value

2019-07-14 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. Gentle ping. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64232/new/ https://reviews.llvm.org/D64232 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[PATCH] D64271: [analyzer] Don't track the right hand side of the last store for conditions

2019-07-14 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. In D64271#1576872 , @NoQ wrote: > I'd rather not abandon this patch, because it looks like a strict improvement > over the lack of condition tracking, and it might as well still be an > improvement over "zealous" condition trac

[PATCH] D64232: [analyzer] Prune calls to functions with linear CFGs that return a non-zero constrained value

2019-07-14 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus marked an inline comment as done. Szelethus added inline comments. Comment at: clang/test/Analysis/uninit-vals.c:181 void testUseHalfPoint() { - struct Point p = getHalfPoint(); // expected-note{{Calling 'getHalfPoint'}} - // expected

[PATCH] D64232: [analyzer] Prune calls to functions with linear CFGs that return a non-zero constrained value

2019-07-15 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus marked 2 inline comments as done. Szelethus added inline comments. Comment at: clang/test/Analysis/track-control-dependency-conditions.cpp:185 return true; return coin(); // tracking-note{{Returning value}} } NoQ wrote: > Szelethus wrote: > > T

[PATCH] D64274: [analyzer] VirtualCallChecker overhaul.

2019-07-15 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. In D64274#1574086 , @NoQ wrote: > Hmm, wait, i don't really break backwards compatibility. Fridays... //Ackchyually//, it doesn't per se break anything, but will result in CodeChecker no longer enabling `optin.cplusplus.Virtu

[PATCH] D64274: [analyzer] VirtualCallChecker overhaul.

2019-07-15 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Checkers/Checkers.td:562 + HelpText<"Check virtual function calls during construction/destruction">, Documentation; Szelethus wrote: > Szelethus wrote: > > `Dependencies<[PureVi

[PATCH] D64454: [clang-tidy] Adding static analyzer check to list of clang-tidy checks

2019-07-15 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. I don't see obvious red flags strictly regarding the analyzer! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64454/new/ https://reviews.llvm.org/D64454 ___ cfe-commits mailin

[PATCH] D63279: [Analyzer] Unroll for-loops where the upper boundary is a variable with know value

2019-07-15 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus requested changes to this revision. Szelethus added inline comments. This revision now requires changes to proceed. Comment at: lib/StaticAnalyzer/Core/LoopUnrolling.cpp:214-216 + const Expr *BoundExpr = CondOp->getLHS()->IgnoreParenImpCasts(); + if (BoundExpr == Matc

[PATCH] D62525: [Analyzer] Add new visitor to the iterator checkers

2019-07-15 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added inline comments. Comment at: lib/StaticAnalyzer/Checkers/IteratorChecker.cpp:1099 reportOutOfRangeBug("Iterator decremented ahead of its valid range.", LHS, -C, N); +C, N, Pos, false); } `/*P

[PATCH] D64274: [analyzer] VirtualCallChecker overhaul.

2019-07-15 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. Also, shouldn't we add this to the release notes? In general, it's be around time to sort it out (might do that myself before the new branch). CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64274/new/ https://reviews.llvm.org/D64274

[PATCH] D64454: [clang-tidy] Adding static analyzer check to list of clang-tidy checks

2019-07-16 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. In D64454#1587102 , @aaron.ballman wrote: > I think this looks reasonable to me, though I am still not certain if the > relative path in the python script will work with both the svn in-tree > directory layout as well as the g

[PATCH] D59555: [analyzer] Add yaml parser to GenericTaintChecker

2019-07-16 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. Starting to look real good! Comment at: include/clang/StaticAnalyzer/Checkers/Checkers.td:807 + "", + Released>, + ]>, We mark options that are not yet ready for used with `InAlpha`, rather then `Re

[PATCH] D59555: [analyzer] Add yaml parser to GenericTaintChecker

2019-07-17 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. Hmm, okay, so we convert `-1` from the config file to `UINT_MAX` in the code, I like it! I wrote a couple nits but they really are just that. In general, for each different error message, a different test case would be great. Comment at: include/cl

[PATCH] D63279: [Analyzer] Unroll for-loops where the upper boundary is a variable with know value

2019-07-17 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. I think you forgot to remove `/* */` and clang formatting before uploading the patch. Comment at: lib/StaticAnalyzer/Core/LoopUnrolling.cpp:214-216 + const Expr *BoundExpr = CondOp->getLHS()->IgnoreParenImpCasts(); + if (BoundExpr == Matches[0].get

[PATCH] D64232: [analyzer] Prune calls to functions with linear CFGs that return a non-zero constrained value

2019-07-17 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus updated this revision to Diff 210330. Szelethus added a comment. Rebase on top master. Putting this on the bottom of the patch stack because this really deserves it's own analysis. (Side note, I completely messed up like ~40 hrs worth of analysis because I didn't check which branches d

[PATCH] D64287: [analyzer] Track the right hand side of the last store regardless of its value

2019-07-17 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus updated this revision to Diff 210333. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64287/new/ https://reviews.llvm.org/D64287 Files: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp clang/test/Analysis/track-control-dependency-conditions.cpp clang/test/Analysis/unin

[PATCH] D64270: [analyzer][NFC] Prepare visitors for different tracking kinds

2019-07-17 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus updated this revision to Diff 210337. Szelethus marked an inline comment as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64270/new/ https://reviews.llvm.org/D64270 Files: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h clang/lib/StaticAnalyz

[PATCH] D64272: [analyzer] Note last writes to a condition only in a nested stackframe

2019-07-17 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus updated this revision to Diff 210340. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64272/new/ https://reviews.llvm.org/D64272 Files: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp clang/test

[PATCH] D64287: [analyzer] Track the right hand side of the last store regardless of its value

2019-07-17 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. In D64287#1589941 , @xazax.hun wrote: > LGTM! > > Since we allow new kinds of SVals to be tracked it would be great to test > this first on a larger corpus of projects just to see if there is a crash > (due to an unhandled SVal

[PATCH] D64270: [analyzer][NFC] Prepare visitors for different tracking kinds

2019-07-17 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus marked an inline comment as done. Szelethus added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h:110 + ConditionTracking +}; + Charusso wrote: > What about the following? > ``` > enum class Track

[PATCH] D63279: [Analyzer] Unroll for-loops where the upper boundary is a variable with know value

2019-07-18 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. In D63279#1590676 , @NoQ wrote: > /me has just noticed that this isn't D34812 . Oh great find! Is it worth ~~seizing~~ commandeering @baloghadamsoftware? CHANGES SINCE LAST ACTION https://re

[PATCH] D64272: [analyzer] Note last writes to a condition only in a nested stackframe

2019-07-18 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus marked 2 inline comments as done. Szelethus added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:1447-1454 // If we have an expression that provided the value, try to track where it // came from. if (InitE) { if (!IsPara

[PATCH] D59555: [analyzer] Add yaml parser to GenericTaintChecker

2019-07-18 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added inline comments. Comment at: lib/StaticAnalyzer/Checkers/Yaml.h:48 + return Config; +} Szelethus wrote: > ```lang=c++ > } // end of namespace clang > } // end of namespace ento > ``` I mean, the other way around >.< Comment at:

[PATCH] D64991: [analyzer][WIP] Implement a primitive reaching definitions analysis

2019-07-19 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus created this revision. Szelethus added reviewers: NoQ, xazax.hun, baloghadamsoftware, Charusso, rnkovacs, a_sidorin, dcoughlin. Szelethus added a project: clang. Herald added subscribers: cfe-commits, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, szepet, whisperity, mgorny.

[PATCH] D64232: [analyzer] Prune calls to functions with linear CFGs that return a non-zero constrained value

2019-07-20 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. LLVM+Clang (A total of 207 reports changed) | with "track-conditions" set to true (bug length)

[PATCH] D64374: [analyzer] CastValueChecker: Model casts

2019-07-20 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. I guess `getAs` and `castAs` methods could join the party too. I'm evaluating plenty of results on LLVM, and those seem to be in the same problem category. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64374/new/ https://reviews.llvm.org/D64374 ___

[PATCH] D59555: [analyzer] Add yaml parser to GenericTaintChecker

2019-07-21 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus accepted this revision. Szelethus added a comment. LGTM, thanks! Please mark inlines as done as you fix them. If you like the file description I proposed, I'm happy to commit this on your behalf (or you might as well apply for a commit access, since you have a track record of high qua

[PATCH] D64991: [analyzer][WIP] Implement a primitive reaching definitions analysis

2019-07-22 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus updated this revision to Diff 29. Szelethus added a comment. I plan to split this patch up eventually, but here's where I'm standing right now: - Correct the algorithm that by accident did this: `GEN[B] = GEN[B] union (IN[B] - KILL[B])` instead of this: `OUT[B] = GEN[B] union (IN[

[PATCH] D64991: [analyzer][WIP] Implement a primitive reaching definitions analysis

2019-07-22 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. In D64991#1596292 , @NoQ wrote: > In D64991#1595853 , @Szelethus wrote: > > > `CFGElementRef` > > > Wait, is it a thing already?? Did i miss anything??? Oh, yea, I have it locally, still

[PATCH] D64991: [analyzer][WIP] Implement a primitive reaching definitions analysis

2019-07-23 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a reviewer: steakhal. Szelethus added a subscriber: steakhal. Szelethus added a comment. @steakhal you some great experience with (strict) aliasing, could you chip in on this maybe? :) CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64991/new/ https://reviews.llvm.org/D64

[PATCH] D65180: [analyzer] VirtualCallChecker: Improve warning messages.

2019-07-24 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. Yay! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65180/new/ https://reviews.llvm.org/D65180 ___ cfe-commits mailing list cfe-com

[PATCH] D65182: [analyzer] WIP: Add fix-it hint support.

2019-07-24 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. Woah, nice! How does an `-analyzer-config fixits-as-warnings` option sound like for more readable tests? 01 Obj obj6 = /**/; // expected-warning{{Value stored to 'obj6' during its initialization is never read}} 02 // expected-warning@-1{{FixIt: Re

[PATCH] D65196: [CFG] Introduce CFGElementRef, a wrapper that knows it's position in a CFGBlock

2019-07-24 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus created this revision. Szelethus added reviewers: NoQ, xazax.hun, baloghadamsoftware, Charusso, dcoughlin, rnkovacs, a_sidorin. Szelethus added a project: clang. Herald added subscribers: cfe-commits, gamesh411, dkrupp. Previously, collecting `CFGElement`s in a set was practially imposs

[PATCH] D64991: [analyzer][WIP] Implement a primitive reaching definitions analysis

2019-07-24 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus updated this revision to Diff 211457. Szelethus added a comment. Rebase on top of D65196 . CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64991/new/ https://reviews.llvm.org/D64991 Files: clang/include/clang/Analysis/Analyses/ReachingDefiniti

[PATCH] D64991: [analyzer][WIP] Implement a primitive reaching definitions analysis

2019-07-24 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus updated this revision to Diff 211509. Szelethus added a comment. Use the correct sorting for the GEN, KILL, IN and OUT sets. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64991/new/ https://reviews.llvm.org/D64991 Files: clang/include/clang/Analysis/Analyses/ReachingDefinit

[PATCH] D64274: [analyzer] VirtualCallChecker overhaul.

2019-07-25 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus requested changes to this revision. Szelethus added a comment. This revision now requires changes to proceed. If either checker emits an error, the current implementation would say it originates from `cplusplus.PureVirtualCall`. Could you please create a new `ProgramPointTag` with the

[PATCH] D64232: [analyzer] Prune calls to functions with linear CFGs that return a non-zero constrained value

2019-07-25 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus updated this revision to Diff 211744. Szelethus added a comment. - Be even more strict on the rule: mark the note as prunable even if the note message says `.*(loaded from '')`. This is okay, because `ReturnVisitor` will track the return value anyways, and if at least a single non-pru

[PATCH] D64270: [analyzer][NFC] Prepare visitors for different tracking kinds

2019-07-25 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus updated this revision to Diff 211752. Szelethus added a comment. - Make sure that the tracking kind is forwarded for each invocation of `trackExpressionValue` in `BugReporterVisitor.cpp` - Expose the tracking kind to all users - Add some more docs CHANGES SINCE LAST ACTION https://r

[PATCH] D64272: [analyzer] Note last writes to a condition only in a nested stackframe

2019-07-25 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus updated this revision to Diff 211758. Szelethus added a comment. - Only in a **nested** stackframe. Not different stackframe. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64272/new/ https://reviews.llvm.org/D64272 Files: clang/include/clang/StaticAnalyzer/Core/BugReporter/

[PATCH] D65287: [analyzer][CFG] Don't track the condition of asserts

2019-07-25 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus created this revision. Szelethus added reviewers: NoQ, xazax.hun, baloghadamsoftware, Charusso, a_sidorin, rnkovacs, dcoughlin. Szelethus added a project: clang. Herald added subscribers: cfe-commits, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, szepet, whisperity. Well,

[PATCH] D65290: [analyzer][NFC] Prove that we only track the evaluated part of the condition

2019-07-25 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus created this revision. Szelethus added reviewers: NoQ, xazax.hun, Charusso, rnkovacs, baloghadamsoftware, dcoughlin. Szelethus added a project: clang. Herald added subscribers: cfe-commits, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, szepet, whisperity. Szelethus added a

[PATCH] D65378: [analyzer][NFC] Refactoring BugReporter.cpp P1.: Store interesting symbols/regions in a simple set

2019-07-28 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus created this revision. Szelethus added reviewers: NoQ, xazax.hun, rnkovacs, Charusso, baloghadamsoftware, dcoughlin. Szelethus added a project: clang. Herald added subscribers: cfe-commits, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, szepet, whisperity. The goal of this

[PATCH] D65381: [analyzer][NFC] Refactoring BugReporter.cpp P3.: std::shared_pointer -> PathDiagnosticPieceRef

2019-07-28 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus created this revision. Szelethus added reviewers: NoQ, xazax.hun, rnkovacs, baloghadamsoftware, dcoughlin, Charusso. Szelethus added a project: clang. Herald added subscribers: cfe-commits, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, szepet, whisperity. Szelethus edited t

[PATCH] D65382: [analyzer][NFC] Refactoring BugReporter.cpp P4.: If it can be const, make it const

2019-07-28 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus created this revision. Szelethus added reviewers: NoQ, xazax.hun, Charusso, dcoughlin, baloghadamsoftware, rnkovacs. Szelethus added a project: clang. Herald added subscribers: cfe-commits, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, szepet, whisperity. When I'm new to a

[PATCH] D65484: [analyzer][NFC] Refactoring BugReporter.cpp P5.: Compact mile long function invocations into objects

2019-07-30 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus created this revision. Szelethus added reviewers: NoQ, xazax.hun, baloghadamsoftware, Charusso, dcoughlin, rnkovacs. Szelethus added a project: clang. Herald added subscribers: cfe-commits, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, szepet, whisperity. This patch is sca

[PATCH] D65487: [analyzer][NFC] Refactoring BugReporter.cpp P6.: Completely get rid of interestingness propagation

2019-07-30 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus created this revision. Szelethus added reviewers: NoQ, xazax.hun, rnkovacs, baloghadamsoftware, Charusso, dcoughlin. Szelethus added a project: clang. Herald added subscribers: cfe-commits, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, szepet, whisperity. Do you remember t

[PATCH] D62525: [Analyzer] Add new visitor to the iterator checkers

2019-07-31 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. I don't see obvious red flags here, @NoQ? In D62525#1523026 , @baloghadamsoftware wrote: > In D62525#1519868 , @NoQ wrote: > > > In D62525#1519475

[PATCH] D59637: [analyzer] Use the custom propagation rules and sinks in GenericTaintChecker

2019-07-31 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. In general, don't emit to stderr unless we either emit a warning/error about the incorrect configuration. As an experiment, what happens when you try to emit an error in the middle of the symbolic execution? You can retrieve a `DiagnosticsEngine` from any decl: `D->ge

[PATCH] D59516: [analyzer] Add custom filter functions for GenericTaintChecker

2019-07-31 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. In general, the patch is looking alright, I'll take a second look later on. Don't mind my inlines too much, they are more directed towards the original code then your changes. Comment at: lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp:53-56 +

[PATCH] D62688: [Analyzer] Iterator Checkers - Model `empty()` method of containers

2019-07-31 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. In D62688#1606096 , @baloghadamsoftware wrote: > In D62688#1549574 , @Szelethus wrote: > > > Hmm, an idea just popped into my head. I'm not sure whether we have a > > single checker that

[PATCH] D62893: [Analyzer] Iterator Checkers - Make range errors and invalidated access fatal

2019-07-31 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. Makes sense! But, does any of the test cases actually test *this* particular change? Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62893/new/ https://re

[PATCH] D62895: [Analyzer] Iterator Checkers - Check and simulate `std::advance`, `std::prev` and `std::next`

2019-07-31 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. Again, this a place where a debugging functionality would be awesome to precisely observe the change being made. I also noticed that `IteratorChecker` and related classes don't have any dump methods, maybe that is worth investing into as well? Repository: rC Clang

[PATCH] D64232: [analyzer] Prune calls to functions with linear CFGs that return a non-zero constrained value

2019-08-01 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus updated this revision to Diff 212801. Szelethus added a comment. Use `size() == 3` instead if `isLinear()`, add a related test case. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64232/new/ https://reviews.llvm.org/D64232 Files: clang/lib/StaticAnalyzer/Core/BugReporterVisi

[PATCH] D65287: [analyzer][CFG] Don't track the condition of asserts

2019-08-01 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus updated this revision to Diff 212803. Szelethus marked 10 inline comments as done. Szelethus added a comment. Fixes according to reviewer comments! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65287/new/ https://reviews.llvm.org/D65287 Files: clang/include/clang/Analysis/C

[PATCH] D65287: [analyzer][CFG] Don't track the condition of asserts

2019-08-01 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus marked an inline comment as done. Szelethus added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:1753-1755 + // It so happens that CFGBlock::getTerminatorCondition returns 'A' for block + // B1, 'A && B' for B2, and 'A && B || C' fo

[PATCH] D65575: [analyzer] Mention whether an event is about a condition in a bug report part 1

2019-08-01 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus created this revision. Szelethus added reviewers: NoQ, xazax.hun, Charusso, baloghadamsoftware, dcoughlin, rnkovacs. Szelethus added a project: clang. Herald added subscribers: cfe-commits, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, szepet, whisperity. Can't add much mo

[PATCH] D65379: [analyzer][NFC] Refactoring BugReporter.cpp P2.: Clean up the construction of bug paths and finding a valid report

2019-08-01 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus updated this revision to Diff 212806. Szelethus marked 2 inline comments as done. Szelethus added a comment. clang-format, rephrase the comment. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65379/new/ https://reviews.llvm.org/D65379 Files: clang/include/clang/StaticAnalyze

[PATCH] D65381: [analyzer][NFC] Refactoring BugReporter.cpp P3.: std::shared_pointer -> PathDiagnosticPieceRef

2019-08-01 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus updated this revision to Diff 212807. Szelethus marked 5 inline comments as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65381/new/ https://reviews.llvm.org/D65381 Files: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h clang/include/clang/St

[PATCH] D65382: [analyzer][NFC] Refactoring BugReporter.cpp P4.: If it can be const, make it const

2019-08-01 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus updated this revision to Diff 212808. Szelethus added a comment. Don't return `ProgramStateManager` and `SValBuilder` by const reference. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65382/new/ https://reviews.llvm.org/D65382 Files: clang/include/clang/Analysis/AnalysisDec

[PATCH] D65381: [analyzer][NFC] Refactoring BugReporter.cpp P3.: std::shared_pointer -> PathDiagnosticPieceRef

2019-08-01 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h:244 + const ExplodedNode *N, + const CFGBlock *srcBlk, +

[PATCH] D65578: [analyzer][NFC] Make sure that the BugReport is not modified during the construction of non-visitor pieces

2019-08-01 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus created this revision. Szelethus added reviewers: NoQ, xazax.hun, baloghadamsoftware, Charusso, dcoughlin, rnkovacs. Szelethus added a project: clang. Herald added subscribers: cfe-commits, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, szepet, whisperity. I feel this is ki

<    1   2   3   4   5   6   7   8   9   10   >