[PATCH] D71612: [analyzer] Add PlacementNewChecker

2019-12-17 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/CheckPlacementNew.cpp:22 +ProgramStateRef State) const; + mutable std::unique_ptr BT_Placement; +}; I think now it is safe to have the bugtype by value

[PATCH] D71642: [CFG] Add on option to inline CXXDefaultInitExpr into aggregate initialization

2019-12-17 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun created this revision. xazax.hun added reviewers: NoQ, Szelethus, mgehre. xazax.hun added a project: clang. Herald added subscribers: cfe-commits, Charusso, gamesh411, dkrupp, rnkovacs. This is useful for clients that are relying on linearized CFGs for evaluating subexpressions and

[PATCH] D71642: [CFG] Add an option to inline CXXDefaultInitExpr into aggregate initialization

2019-12-17 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 234427. xazax.hun added a comment. - Add missing tests. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71642/new/ https://reviews.llvm.org/D71642 Files: clang/include/clang/Analysis/CFG.h

[PATCH] D71321: [analyzer] CStringChecker: Warning text fixes.

2019-12-11 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun accepted this revision. xazax.hun added a comment. Cool! :) Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71321/new/ https://reviews.llvm.org/D71321 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D70469: [attributes] [analyzer] Add handle related attributes

2019-12-11 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked an inline comment as done. xazax.hun added inline comments. Comment at: clang/lib/Sema/SemaType.cpp:7424 + ParsedAttr ) { + if (CurType->isFunctionType()) { +State.getSema().Diag(Attr.getLoc(),

[PATCH] D71322: [analyzer] CStringChecker: Fix overly eager assumption that memcmp arguments overlap.

2019-12-11 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun accepted this revision. xazax.hun added a comment. Less state split, yay! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71322/new/ https://reviews.llvm.org/D71322 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D70469: [attributes] [analyzer] Add handle related attributes

2019-12-11 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In D70469#1778609 , @NoQ wrote: > What about `__attribute__((acquire_handle("fuchsia")))` I would by fine with this as well. Aaron? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70469/new/

[PATCH] D71224: [analyzer] Escape symbols stored into specific region after a conservative evalcall.

2019-12-11 Thread Gábor Horváth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG5882e6f36fd9: [analyzer] Escape symbols conjured into specific regions during a conservative… (authored by xazax.hun). Changed prior to commit: https://reviews.llvm.org/D71224?vs=233235=233431#toc

[PATCH] D71371: [analyzer] Do not cache out on some shared implicit AST nodes.

2019-12-11 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun created this revision. xazax.hun added reviewers: NoQ, dcoughlin, Szelethus, baloghadamsoftware, haowei. xazax.hun added a project: clang. Herald added subscribers: Charusso, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet. Some AST nodes that stands for

[PATCH] D71371: [analyzer] Do not cache out on some shared implicit AST nodes.

2019-12-11 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Hmm loops. Right. So this solution is insufficient because it can prevent legitimate caching out in loops. If we remove those initializers from the CFG wouldn't we loose the Pre/PostStmt callbacks? Is that acceptable? If not, we might need to create a new program

[PATCH] D70725: [analyzer] Add path notes to FuchsiaHandleCheck

2019-12-03 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In D70725#1767942 , @NoQ wrote: > Mmm, right, i guess you should also skip adding the tag if the notes array is > empty. > > There might be more complicated use-cases (especially in `ExprEngine` itself) > where you may end up

[PATCH] D70725: [analyzer] Add path notes to FuchsiaHandleCheck

2019-12-03 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 231996. xazax.hun added a comment. - Only add note tag if we have actual notes. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70725/new/ https://reviews.llvm.org/D70725 Files: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h

[PATCH] D70725: [analyzer] Add path notes to FuchsiaHandleCheck

2019-12-03 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked an inline comment as done. xazax.hun added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/FuchsiaHandleChecker.cpp:307 + std::vector> notes; SymbolRef ResultSymbol = nullptr; I will capitalize this name. CHANGES SINCE

[PATCH] D70725: [analyzer] Add path notes to FuchsiaHandleCheck

2019-12-03 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/FuchsiaHandleChecker.cpp:363-366 +if (() != && +() != && +() != ) + return ""; NoQ wrote: > Ugh, it sucks that we have to do this by hand. > > Why would

[PATCH] D70725: [analyzer] Add path notes to FuchsiaHandleCheck

2019-12-03 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 231989. xazax.hun marked 5 inline comments as done. xazax.hun added a comment. - Address review comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70725/new/ https://reviews.llvm.org/D70725 Files:

[PATCH] D70725: [analyzer] Add path notes to FuchsiaHandleCheck

2019-12-03 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In D70725#1767673 , @NoQ wrote: > In D70725#1767643 , @Charusso wrote: > > > In D70725#1767579 , @xazax.hun > > wrote: > > > > > Just a small

[PATCH] D70693: [scan-build-py] Set of small fixes

2019-12-05 Thread Gábor Horváth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG8994d632c8d3: [scan-build-py] Set of small fixes (authored by xazax.hun). Changed prior to commit: https://reviews.llvm.org/D70693?vs=230960=232364#toc Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D71041: [analyzer][discussion] Talk about escapes

2019-12-05 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked an inline comment as done. xazax.hun added inline comments. Comment at: clang/test/Analysis/fuchsia_handle.cpp:210 + // Because of arrays, structs, the suggestion is to escape when whe no longer + // have any pointer to that symbolic region. + if

[PATCH] D71041: [analyzer][discussion] Talk about escapes

2019-12-05 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked an inline comment as done. xazax.hun added inline comments. Comment at: clang/test/Analysis/fuchsia_handle.cpp:210 + // Because of arrays, structs, the suggestion is to escape when whe no longer + // have any pointer to that symbolic region. + if

[PATCH] D71041: [analyzer][discussion] Talk about escapes

2019-12-05 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked an inline comment as done. xazax.hun added inline comments. Comment at: clang/test/Analysis/fuchsia_handle.cpp:210 + // Because of arrays, structs, the suggestion is to escape when whe no longer + // have any pointer to that symbolic region. + if

[PATCH] D71041: [analyzer][discussion] Talk about escapes

2019-12-05 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked an inline comment as done. xazax.hun added inline comments. Comment at: clang/test/Analysis/fuchsia_handle.cpp:210 + // Because of arrays, structs, the suggestion is to escape when whe no longer + // have any pointer to that symbolic region. + if

[PATCH] D71041: [analyzer][discussion] Talk about escapes

2019-12-05 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked an inline comment as done. xazax.hun added inline comments. Comment at: clang/test/Analysis/fuchsia_handle.cpp:210 + // Because of arrays, structs, the suggestion is to escape when whe no longer + // have any pointer to that symbolic region. + if

[PATCH] D70469: [attributes] [analyzer] Add handle related attributes

2019-12-07 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 232723. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70469/new/ https://reviews.llvm.org/D70469 Files: clang/include/clang/Basic/Attr.td clang/include/clang/Basic/AttrDocs.td clang/include/clang/Basic/DiagnosticSemaKinds.td

[PATCH] D70469: [attributes] [analyzer] Add handle related attributes

2019-12-07 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked 2 inline comments as done. xazax.hun added inline comments. Comment at: clang/test/Sema/attr-handles.cpp:20-21 +void ht(int __attribute__((acquire_handle(1))) *a); // expected-error {{'acquire_handle' attribute takes no arguments}} +int it()

[PATCH] D70469: [attributes] [analyzer] Add handle related attributes

2019-12-08 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked an inline comment as done. xazax.hun added inline comments. Comment at: clang/lib/Sema/SemaType.cpp:7424 + ParsedAttr ) { + if (CurType->isFunctionType()) { +State.getSema().Diag(Attr.getLoc(),

[PATCH] D70469: [attributes] [analyzer] Add handle related attributes

2019-12-16 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked an inline comment as done. xazax.hun added inline comments. Comment at: clang/lib/Sema/SemaType.cpp:7424 + ParsedAttr ) { + if (CurType->isFunctionType()) { +State.getSema().Diag(Attr.getLoc(),

[PATCH] D70469: [attributes] [analyzer] Add handle related attributes

2019-12-10 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In D70469#1777858 , @aaron.ballman wrote: > In D70469#1776523 , @NoQ wrote: > > > It still mildly worries me that the attributes aren't truly reusable, as > > the exact meaning of the

[PATCH] D71152: [analyzer] Keep track of escaped locals.

2019-12-10 Thread Gábor Horváth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGf3a28202ef58: [analyzer] Keep track of escaped locals (authored by xazax.hun). Changed prior to commit: https://reviews.llvm.org/D71152?vs=232675=233124#toc Repository: rG LLVM Github Monorepo

[PATCH] D71224: [analyzer] Escape symbols stored into specific region after a conservative evalcall.

2019-12-09 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked an inline comment as done. xazax.hun added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp:603 + // point. + class CollectReachableSymbolsCallback final : public SymbolVisitor { +ProgramStateRef State;

[PATCH] D71041: [analyzer][discussion] Talk about escapes

2019-12-09 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. This is the next one: https://reviews.llvm.org/D71224 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71041/new/ https://reviews.llvm.org/D71041 ___ cfe-commits mailing list

[PATCH] D71224: [analyzer] Escape symbols stored into specific region after a conservative evalcall.

2019-12-09 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 232982. xazax.hun added a comment. - Reuse `ExprEngine::escapeValue`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71224/new/ https://reviews.llvm.org/D71224 Files: clang/include/clang/StaticAnalyzer/Checkers/Checkers.td

[PATCH] D71224: [analyzer] Escape symbols stored into specific region after a conservative evalcall.

2019-12-09 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 232968. xazax.hun edited the summary of this revision. xazax.hun added a comment. - Added a test. More rigorous tests will come in the FuchsiaHandleChecker. - Added a new PSK_ entry. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71224/new/

[PATCH] D71224: [analyzer] Escape symbols stored into specific region after a conservative evalcall.

2019-12-09 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked an inline comment as done. xazax.hun added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp:603 + // point. + class CollectReachableSymbolsCallback final : public SymbolVisitor { +ProgramStateRef State;

[PATCH] D71224: [analyzer] Escape symbols stored into specific region after a conservative evalcall.

2019-12-09 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked an inline comment as done. xazax.hun added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp:603 + // point. + class CollectReachableSymbolsCallback final : public SymbolVisitor { +ProgramStateRef State;

[PATCH] D71224: [analyzer] Escape symbols stored into specific region after a conservative evalcall.

2019-12-09 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked an inline comment as done. xazax.hun added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp:648 + continue; +State->scanReachableSymbols(Call.getArgSVal(Arg), Scanner); + } NoQ wrote: >

[PATCH] D71371: [analyzer] Do not cache out on some shared implicit AST nodes.

2019-12-11 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 233467. xazax.hun edited the summary of this revision. xazax.hun added a comment. - Omit nodes from CFG instead of trying to make the states distinct. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71371/new/ https://reviews.llvm.org/D71371

[PATCH] D71371: [analyzer] Do not cache out on some shared implicit AST nodes.

2019-12-11 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 233468. xazax.hun added a comment. - Removed leftover code from previous approach. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71371/new/ https://reviews.llvm.org/D71371 Files: clang/include/clang/Analysis/CFG.h clang/lib/Analysis/CFG.cpp

[PATCH] D71371: [analyzer] Do not cache out on some shared implicit AST nodes.

2019-12-11 Thread Gábor Horváth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG9fdcae7c81f5: [analyzer] Do not cache out on some shared implicit AST nodes (authored by xazax.hun). Changed prior to commit: https://reviews.llvm.org/D71371?vs=233468=233475#toc Repository: rG LLVM

[PATCH] D71224: [analyzer] Escape symbols stored into specific region after a conservative evalcall.

2019-12-10 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked an inline comment as done. xazax.hun added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp:624 +if (const MemRegion *MR = Call.getArgSVal(Arg).getAsRegion()) + if (!MR->hasStackStorage()) +

[PATCH] D71224: [analyzer] Escape symbols stored into specific region after a conservative evalcall.

2019-12-10 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked an inline comment as done. xazax.hun added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp:624 +if (const MemRegion *MR = Call.getArgSVal(Arg).getAsRegion()) + if (!MR->hasStackStorage()) +

[PATCH] D71224: [analyzer] Escape symbols stored into specific region after a conservative evalcall.

2019-12-10 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked an inline comment as done. xazax.hun added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp:624 +if (const MemRegion *MR = Call.getArgSVal(Arg).getAsRegion()) + if (!MR->hasStackStorage()) +

[PATCH] D70469: [attributes] [analyzer] Add handle related attributes

2019-11-19 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked an inline comment as done. xazax.hun added inline comments. Comment at: clang/lib/Sema/SemaDeclAttr.cpp:7287 + case ParsedAttr::AT_AcquireHandle: +handleSimpleAttribute(S, D, AL); +break; NoQ wrote: > xazax.hun wrote: > > NoQ wrote: > >

[PATCH] D70470: [analyzer] Add FuchsiaHandleCheck to catch handle leaks, use after frees and double frees

2019-11-19 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked an inline comment as done. xazax.hun added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/FuchsiaHandleChecker.cpp:67 +// functions: +// 1. __attribute__((clang::acquire_handle)) |handle will be acquired +// 2.

[PATCH] D70470: [analyzer] Add FuchsiaHandleCheck to catch handle leaks, use after frees and double frees

2019-11-19 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked 13 inline comments as done. xazax.hun added a comment. Thanks for the review! I am not very well versed in Fuchsia's syscalls yet but my understanding is that not all of the syscalls can fail so we do not need all the users to check for errors. But this is something I will

[PATCH] D70470: [analyzer] Add FuchsiaHandleCheck to catch handle leaks, use after frees and double frees

2019-11-19 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 230187. xazax.hun added a comment. - Addressed **some** of the review comments. More changes are planned :) CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70470/new/ https://reviews.llvm.org/D70470 Files:

[PATCH] D70469: [attributes] [analyzer] Add handle related attributes

2019-11-19 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked an inline comment as done. xazax.hun added inline comments. Comment at: clang/lib/Sema/SemaDeclAttr.cpp:7287 + case ParsedAttr::AT_AcquireHandle: +handleSimpleAttribute(S, D, AL); +break; NoQ wrote: > The next obvious step here would be

[PATCH] D70470: [analyzer] Add FuchsiaHandleCheck to catch handle leaks, use after frees and double frees

2019-11-26 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 231089. xazax.hun added a comment. - Handle cases where the number of args/params mismatch. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70470/new/ https://reviews.llvm.org/D70470 Files: clang/docs/analyzer/checkers.rst

[PATCH] D70725: [analyzer] Add path notes to FuchsiaHandleCheck

2019-11-26 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun created this revision. xazax.hun added reviewers: NoQ, haowei. xazax.hun added a project: clang. Herald added subscribers: Charusso, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware. xazax.hun added a reviewer: Szelethus.

[PATCH] D46027: [clang-tidy] Fix PR35824

2019-11-26 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 231078. xazax.hun added a comment. Herald added subscribers: Charusso, gamesh411. - Use matcher. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D46027/new/ https://reviews.llvm.org/D46027 Files:

[PATCH] D70470: [analyzer] Add FuchsiaHandleCheck to catch handle leaks, use after frees and double frees

2019-11-26 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Ok, now I have some real world experience with the results of the check. The false positive ratio for double free and use after free seems to be quite good but the handle leak part is almost unusable at this point. The main problem is somewhat anticipated, we are not

[PATCH] D70755: [LifetimeAnalysis] Fix PR44150

2019-11-26 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun created this revision. xazax.hun added reviewers: gribozavr, mgehre. xazax.hun added a project: clang. Herald added subscribers: Szelethus, Charusso, gamesh411, dkrupp, rnkovacs. We really wanted to avoid special handling of references but it looks like this is inevitable. The main

[PATCH] D70755: [LifetimeAnalysis] Fix PR44150

2019-11-27 Thread Gábor Horváth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGbcd0798c47ca: [LifetimeAnalysis] Fix PR44150 (authored by xazax.hun). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70755/new/

[PATCH] D70469: [attributes] [analyzer] Add handle related attributes

2019-11-27 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked an inline comment as done. xazax.hun added inline comments. Comment at: clang/lib/Sema/SemaDeclAttr.cpp:6524 + if (auto *PVD = dyn_cast(D)) { +if (PVD->getType()->isIntegerType()) { + S.Diag(AL.getLoc(), diag::err_attribute_output_parameter)

[PATCH] D70469: [attributes] [analyzer] Add handle related attributes

2019-11-27 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 231307. xazax.hun marked 5 inline comments as done. xazax.hun added a comment. - Address review comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70469/new/ https://reviews.llvm.org/D70469 Files: clang/include/clang/Basic/Attr.td

[PATCH] D70693: [scan-build-py] Set of small fixes

2019-11-27 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked an inline comment as done. xazax.hun added inline comments. Comment at: clang/tools/scan-build-py/libscanbuild/clang.py:47 cmd.insert(1, '-###') +cmd.append('-fno-color-diagnostics') phosek wrote: > Alternative would be to set

[PATCH] D46234: Mark if a null statement is the result of constexpr folding

2019-11-27 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Herald added subscribers: Charusso, gamesh411, Szelethus. Herald added a project: clang. Just a note for anyone willing to pick this up, PR32203 is also related. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D46234/new/

[PATCH] D46027: [clang-tidy] Fix PR35824

2019-11-27 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Thanks! Updated context for this patch: A superior fix would be to follow through with the approach suggested by Richard in https://reviews.llvm.org/D46234 . However, since I do not have time to finish that and there are people complaining in the PR, I think it is

[PATCH] D70693: [scan-build-py] Set of small fixes

2019-11-27 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. So after investigating the effects of this patch, the result is the following: Verbose mode (`-v`) that also prints findings to the command line will no longer be colored after the patch. If we do not want this regression there are two easy ways around it: 1. Make

[PATCH] D70469: [attributes] [analyzer] Add handle related attributes

2019-11-27 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang/include/clang/Basic/Attr.td:3445 + let Spellings = [Clang<"acquire_handle">]; + let Subjects = SubjectList<[Function, ParmVar], ErrorDiag>; + let Documentation = [AcquireHandleDocs]; aaron.ballman wrote: >

[PATCH] D46027: [clang-tidy] Fix PR35824

2019-11-27 Thread Gábor Horváth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG5c5e860535d8: [clang-tidy] Fix PR35824 (authored by xazax.hun). Herald added a project: clang. Changed prior to commit: https://reviews.llvm.org/D46027?vs=231078=231301#toc Repository: rG LLVM

[PATCH] D70725: [analyzer] Add path notes to FuchsiaHandleCheck

2019-12-02 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. I was thinking about note tags, but since we iterate on the argument/parameter pairs and might change the state in each iteration we would need to add a new transition after each change. I was wondering if using note tags would worth the cost (both in performance due

[PATCH] D70725: [analyzer] Add path notes to FuchsiaHandleCheck

2019-12-02 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Sorry, my previous comment might not be clear. The point is, the same call might both acquire and release handles (there are such calls in Fuchsia), so we might end up adding more than one note for a call for which we would need to add more than one transitions. If

[PATCH] D70725: [analyzer] Add path notes to FuchsiaHandleCheck

2019-12-02 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked 3 inline comments as done. xazax.hun added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/FuchsiaHandleChecker.cpp:261 + + // TODO: do we want to emit notes for escapes? + // do we want to emit notes for for error checks? I.e. on which

[PATCH] D70469: [attributes] [analyzer] Add handle related attributes

2019-12-02 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. @aaron.ballman Type attributes are definitely more flexible as in they can be applied in more contexts. These attributes, however, make no sense outside of a function declaration, or maybe a type alias. So I feel like we could argue on both sides. I made a minimal

[PATCH] D70469: [attributes] [analyzer] Add handle related attributes

2019-12-02 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 231784. xazax.hun added a comment. - Convert to type attributes. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70469/new/ https://reviews.llvm.org/D70469 Files: clang/include/clang/Basic/Attr.td clang/include/clang/Basic/AttrDocs.td

[PATCH] D70693: [scan-build-py] Set of small fixes

2019-11-25 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun created this revision. xazax.hun added reviewers: NoQ, haowei, rizsotto.mailinglist. Herald added subscribers: Charusso, gamesh411, Szelethus, dkrupp, rnkovacs, whisperity. Herald added a project: clang. xazax.hun added a subscriber: phosek. This patch fix some small errors in

[PATCH] D70693: [scan-build-py] Set of small fixes

2019-11-25 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Sorry, there was a brain hiccup on my side. We just do not generate HTMLs for every translation units (which is the case for plists). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70693/new/

[PATCH] D70469: [attributes] [analyzer] Add handle related attributes

2019-11-20 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 230347. xazax.hun marked 8 inline comments as done. xazax.hun added a comment. - Address review comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70469/new/ https://reviews.llvm.org/D70469 Files: clang/include/clang/Basic/Attr.td

[PATCH] D70470: [analyzer] Add FuchsiaHandleCheck to catch handle leaks, use after frees and double frees

2019-11-20 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 230287. xazax.hun marked 10 inline comments as done. xazax.hun added a comment. - Explicitly model "maybe" states. - Fix some escaping issues. - Address most review comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70470/new/

[PATCH] D70469: [attributes] [analyzer] Add handle related attributes

2019-11-20 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked 3 inline comments as done. xazax.hun added inline comments. Comment at: clang/include/clang/Basic/Attr.td:3445 + let Spellings = [Clang<"acquire_handle">]; + let Subjects = SubjectList<[Function, ParmVar], ErrorDiag>; + let Documentation =

[PATCH] D70469: [attributes] [analyzer] Add handle related attributes

2019-11-20 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 230294. xazax.hun added a comment. - Check trivial cases when the acquire_handle attribute is not on an output parameter. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70469/new/ https://reviews.llvm.org/D70469 Files:

[PATCH] D70469: [attributes] [analyzer] Add handle related attributes

2019-11-19 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun created this revision. xazax.hun added reviewers: aaron.ballman, NoQ. xazax.hun added a project: clang. Herald added subscribers: Charusso, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, whisperity. These are three new

[PATCH] D70470: [analyzer] Add FuchsiaHandleCheck to catch handle leaks, use after frees and double frees

2019-11-19 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun created this revision. xazax.hun added reviewers: NoQ, haowei. xazax.hun added a project: clang. Herald added subscribers: Charusso, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, whisperity, mgorny. This check is based on

[PATCH] D70470: [analyzer] Add FuchsiaHandleCheck to catch handle leaks, use after frees and double frees

2019-11-25 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked an inline comment as done. xazax.hun added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/FuchsiaHandleChecker.cpp:336-338 +ProgramStateRef FuchsiaHandleChecker::evalAssume(ProgramStateRef State, +

[PATCH] D71642: [CFG] Add an option to inline CXXDefaultInitExpr into aggregate initialization

2019-12-17 Thread Gábor Horváth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGea93d7d64216: [CFG] Add an option to expand CXXDefaultInitExpr into aggregate initialization (authored by xazax.hun). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D71642: [CFG] Add an option to inline CXXDefaultInitExpr into aggregate initialization

2019-12-17 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 234436. xazax.hun marked 2 inline comments as done. xazax.hun added a comment. - Use range based for. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71642/new/ https://reviews.llvm.org/D71642 Files: clang/include/clang/Analysis/CFG.h

[PATCH] D71791: [CFG] Fix an assertion failure with static initializers

2019-12-20 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun created this revision. xazax.hun added reviewers: Szelethus, NoQ. xazax.hun added a project: clang. Herald added subscribers: cfe-commits, Charusso, gamesh411, dkrupp, rnkovacs. The branches protecting the static initializers have a `DeclStmt` as last `Stmt`. Since it is not an

[PATCH] D70469: [attributes] [analyzer] Add handle related attributes

2019-12-20 Thread Gábor Horváth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGfe17b30a7957: [attributes][analyzer] Add annotations for handles. (authored by xazax.hun). Changed prior to commit: https://reviews.llvm.org/D70469?vs=234341=234940#toc Repository: rG LLVM Github

[PATCH] D70469: [attributes] [analyzer] Add handle related attributes

2019-12-20 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked an inline comment as done. xazax.hun added a comment. Thanks for the review! :) CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70469/new/ https://reviews.llvm.org/D70469 ___ cfe-commits mailing list

[PATCH] D70470: [analyzer] Add FuchsiaHandleCheck to catch handle leaks, use after frees and double frees

2019-12-20 Thread Gábor Horváth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. xazax.hun marked 2 inline comments as done. Closed by commit rG82923c71efa5: [analyzer] Add Fuchsia Handle checker (authored by xazax.hun). Changed prior to commit: https://reviews.llvm.org/D70470?vs=233691=234948#toc

[PATCH] D70725: [analyzer] Add path notes to FuchsiaHandleCheck

2019-12-20 Thread Gábor Horváth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG59878ec8092b: [analyzer] Add path notes to FuchsiaHandleCheck. (authored by xazax.hun). Changed prior to commit: https://reviews.llvm.org/D70725?vs=231996=234952#toc Repository: rG LLVM Github

[PATCH] D70470: [analyzer] Add FuchsiaHandleCheck to catch handle leaks, use after frees and double frees

2019-12-20 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Thanks for the reviews! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70470/new/ https://reviews.llvm.org/D70470 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D70725: [analyzer] Add path notes to FuchsiaHandleCheck

2019-12-20 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Thanks for the reviews! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70725/new/ https://reviews.llvm.org/D70725 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D71642: [CFG] Add an option to inline CXXDefaultInitExpr into aggregate initialization

2019-12-17 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 234435. xazax.hun added a comment. - Remove accidentally added files. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71642/new/ https://reviews.llvm.org/D71642 Files: clang/include/clang/Analysis/CFG.h

[PATCH] D71642: [CFG] Add an option to inline CXXDefaultInitExpr into aggregate initialization

2019-12-17 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 234434. xazax.hun marked 2 inline comments as done. xazax.hun added a comment. - Fix review comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71642/new/ https://reviews.llvm.org/D71642 Files: clang/include/clang/Analysis/CFG.h

[PATCH] D70836: [analysis] Fix value tracking for pointers to qualified types

2019-12-17 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Great! I have one question though. Will this also work as intended with sugared types? (e.g. typedefs) I believe this might be one of the main reason why the original author used canonical types in the first place. Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D71612: [analyzer] Add PlacementNewChecker

2019-12-20 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Checkers/Checkers.td:472 +def PlacementNewChecker : Checker<"PlacementNew">, + HelpText<"Check if default placement new is provided with pointers to " + "sufficient storage capacity">,

[PATCH] D72982: [Clang] Un-break scan-build after integrated-cc1 change

2020-01-21 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Do you have commit access or need someone to commit on your behalf? Also, in case your change made it into the clang 10 release branch this will need to be cherry picked there as well. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D72982: [Clang] Un-break scan-build after integrated-cc1 change

2020-01-21 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In D72982#1831595 , @hans wrote: > Wait, do we really want the "(in-process)" marker to be written to a separate > line? I'm not sure that we do. Since the `-###` command had this property of emitting copy pastable `-cc1`

[PATCH] D72982: [Clang] Un-break scan-build after integrated-cc1 change

2020-01-21 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In D72982#1831817 , @hans wrote: > In D72982#1831648 , @xazax.hun wrote: > > > In D72982#1831595 , @hans wrote: > > > > > Wait, do we really want

[PATCH] D75432: [analyzer][NFC][MallocChecker] Convert many parameters into CallEvent

2020-03-03 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Some nits inline. Comment at: clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp:995 -void MallocChecker::checkBasicAlloc(CheckerContext , const CallExpr *CE, -ProgramStateRef State) const { - State =

[PATCH] D75163: [analyzer][StreamChecker] Adding precall and refactoring.

2020-03-03 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. If we were to refactor this check I wonder if it would make sense to port `evalCall` to `postCall`, so the analyzer engine will conjure the symbol for us. I wonder what @NoQ thinks about the pros and cons of the approaches. As far as I understand the con of evalCall

[PATCH] D75430: [analyzer][NFC] Introduce CXXDeallocatorCall, deploy it in MallocChecker

2020-03-03 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. This might be a silly question but is `CXXDeleteExpr` the only way to invoke a deallocator? What would happen if the user would call it by hand? Should we expect `ExprEngine` to trigger a callback in that case? Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D75431: [analyzer][NFC] Merge checkNewAllocator's paramaters into CXXAllocatorCall

2020-03-03 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Other than a nit looks good to me but wait for @NoQ before committing. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h:208 + SValBuilder () const { +return State->getStateManager().getSValBuilder();

[PATCH] D75163: [analyzer][StreamChecker] Adding precall and refactoring.

2020-03-03 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In D75163#1902921 , @balazske wrote: > In D75163#1902816 , @xazax.hun wrote: > > > If we were to refactor this check I wonder if it would make sense to port > > `evalCall` to `postCall`,

[PATCH] D73729: [analyzer] AnalyzerOptions: Remove 'fixits-as-remarks'

2020-02-25 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a reviewer: Szelethus. xazax.hun added a comment. Herald added subscribers: martong, steakhal. Maybe Kristof has some opinion whether we still need this :) He might be up to date whether CodeChecker is using this feature. Repository: rC Clang CHANGES SINCE LAST ACTION

[PATCH] D73729: [analyzer] AnalyzerOptions: Remove 'fixits-as-remarks'

2020-02-25 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.def:310 -ANALYZER_OPTION(bool, ShouldEmitFixItHintsAsRemarks, "fixits-as-remarks", -"Emit fix-it hints as remarks for testing purposes", -false)

[PATCH] D73376: [analyzer] Add FuchsiaLockChecker and C11LockChecker

2020-01-27 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked 2 inline comments as done. xazax.hun added inline comments. Comment at: clang/test/Analysis/c11lock.c:7 +enum { + thrd_success = 0, + thrd_error = 2 Strictly speaking, this is implementation defined. But the C11 implementations I am aware of

[PATCH] D73376: [analyzer] Add FuchsiaLockChecker and C11LockChecker

2020-01-27 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In D73376#1839818 , @NoQ wrote: > I don't see any immediate solutions to the boilerplate that don't consist in > introducing better checker APIs. Eg., we could have introduced a > `LazyBugType` - a wrapper around `Optional`

[PATCH] D73151: [analyzer] Fix handle leak false positive when the handle dies too early

2020-01-27 Thread Gábor Horváth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGc98d98ba9b0f: [analyzer] Fix handle leak false positive when the handle dies too early (authored by xazax.hun). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

<    3   4   5   6   7   8   9   10   11   12   >