[PATCH] D25326: [StaticAnalyser] Don't merge different returns in ExplodedGraph

2016-10-07 Thread Artem Dergachev via cfe-commits
NoQ added a comment. In https://reviews.llvm.org/D25326#564239, @danielmarjamaki wrote: > ok. As far as I see it's not trivial to know which ReturnStmt there was when > CallExitBegin is created. We're in `HandleBlockEdge`, just pass down the statement from CFG here? In https://reviews.llvm.or

r283536 - [analyzer] Try to re-apply r283092 "Extend bug reports with extra notes"

2016-10-07 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Fri Oct 7 05:44:09 2016 New Revision: 283536 URL: http://llvm.org/viewvc/llvm-project?rev=283536&view=rev Log: [analyzer] Try to re-apply r283092 "Extend bug reports with extra notes" Replace SmallVector with a vector of plain pointers. Would insignificantly increase memo

[PATCH] D25326: [StaticAnalyser] Don't merge different returns in ExplodedGraph

2016-10-07 Thread Artem Dergachev via cfe-commits
NoQ added a comment. In https://reviews.llvm.org/D25326#564291, @danielmarjamaki wrote: > The Blk->dump() says: > > [B0 (EXIT)] > Preds (2): B1 B2 > What about the source block? Repository: rL LLVM https://reviews.llvm.org/D25326 ___ cf

r283537 - Revert "[analyzer] Try to re-apply r283092 "Extend bug reports with extra notes"

2016-10-07 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Fri Oct 7 05:56:44 2016 New Revision: 283537 URL: http://llvm.org/viewvc/llvm-project?rev=283537&view=rev Log: Revert "[analyzer] Try to re-apply r283092 "Extend bug reports with extra notes" Vector of smart pointers wasn't the thing that caused msvc crash. Modified:

r283540 - [analyzer] Re-apply r283092, attempt no.3, in small chunks this time.

2016-10-07 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Fri Oct 7 06:26:15 2016 New Revision: 283540 URL: http://llvm.org/viewvc/llvm-project?rev=283540&view=rev Log: [analyzer] Re-apply r283092, attempt no.3, in small chunks this time. Modified: cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h Modif

r283541 - Revert "[analyzer] Re-apply r283092, attempt no.3, in small chunks this time."

2016-10-07 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Fri Oct 7 06:29:32 2016 New Revision: 283541 URL: http://llvm.org/viewvc/llvm-project?rev=283541&view=rev Log: Revert "[analyzer] Re-apply r283092, attempt no.3, in small chunks this time." Modified: cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.

[PATCH] D25326: [StaticAnalyser] Don't merge different returns in ExplodedGraph

2016-10-07 Thread Artem Dergachev via cfe-commits
NoQ accepted this revision. NoQ added a comment. This revision is now accepted and ready to land. Yay, this is great. Thanks for investigating all those loss of coverage issues! Comment at: lib/StaticAnalyzer/Core/CoreEngine.cpp:610 // Use the callee location context. - Cal

r283566 - [analyzer] Re-apply r283092, attempt no.4, a small chunk.

2016-10-07 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Fri Oct 7 10:23:02 2016 New Revision: 283566 URL: http://llvm.org/viewvc/llvm-project?rev=283566&view=rev Log: [analyzer] Re-apply r283092, attempt no.4, a small chunk. Define PathDiagnosticNotePiece. The next commit would be able to address the BugReport class code that

r283568 - [analyzer] Re-apply r283092, attempt no.4, chunk no.2.

2016-10-07 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Fri Oct 7 10:55:18 2016 New Revision: 283568 URL: http://llvm.org/viewvc/llvm-project?rev=283568&view=rev Log: [analyzer] Re-apply r283092, attempt no.4, chunk no.2. Define the list of pieces in BugReport class. This is half of the changes in the BugReport class code, whi

[PATCH] D25326: [StaticAnalyser] Don't merge different returns in ExplodedGraph

2016-10-07 Thread Artem Dergachev via cfe-commits
NoQ added inline comments. Comment at: test/Analysis/unreachable-code-path.c:201 +static int inlineFunction(const int i) { + if (table[i] != 0) +return 1; a.sidorin wrote: > I have a small question. Is it possible to simplify this sample with removing > of

r283573 - [analyzer] Re-apply r283092, attempt no.4, chunk no.3.

2016-10-07 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Fri Oct 7 12:12:05 2016 New Revision: 283573 URL: http://llvm.org/viewvc/llvm-project?rev=283573&view=rev Log: [analyzer] Re-apply r283092, attempt no.4, chunk no.3. This is the primary suspect for causing the msvc crash, now that vector of smart pointers was proven to be

r283574 - [analyzer] Re-apply r283092, attempt no.4, chunk no.3, fixup 1.

2016-10-07 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Fri Oct 7 12:24:06 2016 New Revision: 283574 URL: http://llvm.org/viewvc/llvm-project?rev=283574&view=rev Log: [analyzer] Re-apply r283092, attempt no.4, chunk no.3, fixup 1. Remove the brace default initializer to see if this is what's causing the msvc crash. Modified:

r283584 - [analyzer] Re-apply r283092, attempt no.4, chunk no.4 (last)

2016-10-07 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Fri Oct 7 14:25:10 2016 New Revision: 283584 URL: http://llvm.org/viewvc/llvm-project?rev=283584&view=rev Log: [analyzer] Re-apply r283092, attempt no.4, chunk no.4 (last) The problem that caused the msvc crash has been indentified and fixed in the previous commit. This p

Re: r283537 - Revert "[analyzer] Try to re-apply r283092 "Extend bug reports with extra notes"

2016-10-07 Thread Artem Dergachev via cfe-commits
r the trouble. 7 октября 2016 г. 23:33:39 GMT+03:00, Bill Seurer пишет: >On 10/07/16 05:56, Artem Dergachev via cfe-commits wrote: > > Author: dergachev > > Date: Fri Oct 7 05:56:44 2016 > > New Revision: 283537 > > > > URL: http://llvm.org/viewvc/llvm-project?rev=

r283660 - [analyzer] Re-apply r283093 "Add extra notes to ObjCDeallocChecker"

2016-10-08 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Sat Oct 8 05:53:00 2016 New Revision: 283660 URL: http://llvm.org/viewvc/llvm-project?rev=283660&view=rev Log: [analyzer] Re-apply r283093 "Add extra notes to ObjCDeallocChecker" The parent commit (r283092) was reverted before and now finally landed. Modified: cfe/tr

r283661 - [analyzer] Re-apply r283094 "Improve CloneChecker diagnostics"

2016-10-08 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Sat Oct 8 05:54:30 2016 New Revision: 283661 URL: http://llvm.org/viewvc/llvm-project?rev=283661&view=rev Log: [analyzer] Re-apply r283094 "Improve CloneChecker diagnostics" The parent commit (r283092) was reverted before and now finally landed. Added: cfe/trunk/test

r283662 - [analyzer] Fix build error after r283660 - remove constexpr strings.

2016-10-08 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Sat Oct 8 06:07:21 2016 New Revision: 283662 URL: http://llvm.org/viewvc/llvm-project?rev=283662&view=rev Log: [analyzer] Fix build error after r283660 - remove constexpr strings. Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp Modified: cfe/trun

[PATCH] D25326: [StaticAnalyser] Don't merge different returns in ExplodedGraph

2016-10-10 Thread Artem Dergachev via cfe-commits
NoQ added a comment. In https://reviews.llvm.org/D25326#565919, @danielmarjamaki wrote: > Ideally it would be possible to run clang-format on the files before > committing. but currently I get lots of unrelated changes then. > > Would it be ok to run clang-format on some files to clean up the fo

[PATCH] D25429: [analyzer] Link libStaticAnalyzerCheckers to libASTMatchers.

2016-10-10 Thread Artem Dergachev via cfe-commits
NoQ created this revision. NoQ added reviewers: zaks.anna, dcoughlin, xazax.hun, a.sidorin, alexfh. NoQ added a subscriber: cfe-commits. Herald added subscribers: mgorny, beanz. ASTMatchers are sometimes handy in the Analyzer, and there are more patches to make use of them. However, it turns out

[PATCH] D25429: [analyzer] Link libStaticAnalyzerCheckers to libASTMatchers.

2016-10-10 Thread Artem Dergachev via cfe-commits
NoQ added a comment. In https://reviews.llvm.org/D25429#565939, @xazax.hun wrote: > I might be confused, but as far as I remember, when you do static linking, > symbols tend to be linked in lazily. So as long as you do not use the > matchers, those numbers might be misleading. Yep, i did actu

Re: r283540 - [analyzer] Re-apply r283092, attempt no.3, in small chunks this time.

2016-10-10 Thread Artem Dergachev via cfe-commits
our builders: http://lab.llvm.org:8011/builders/clang-x86_64-linux-abi-test/builds/21910 Please have a look at it. Thanks Galina On Fri, Oct 7, 2016 at 4:26 AM, Artem Dergachev via cfe-commits mailto:cfe-commits@lists.llvm.org>> wrote: Author: dergachev Date: Fri Oct 7 06:26:1

[PATCH] D25475: [analyzer] Add a new SVal to support pointer-to-member operations.

2016-10-12 Thread Artem Dergachev via cfe-commits
NoQ added a comment. Yay, thanks for posting this! :) I've got a bit of concern for some assert-suppressions. Comment at: lib/StaticAnalyzer/Core/ExprEngine.cpp:2314 { + // Return to fulfil assert condition + if (location.getAs()) Hmm. Why would anybody try

[PATCH] D25503: [analyzer] Remove superquadratic behaviour from DataflowWorklist

2016-10-12 Thread Artem Dergachev via cfe-commits
NoQ added a reviewer: a.sidorin. NoQ added a comment. This looks familiar, i think i've seen significant slowdowns around there on some very rare files. Nice catch! Probably a binary-search insert could have also been much better than re-sorting, even if it's still a vector. Repository: rL L

[PATCH] D25503: [analyzer] Remove superquadratic behaviour from DataflowWorklist

2016-10-13 Thread Artem Dergachev via cfe-commits
NoQ accepted this revision. NoQ added a comment. In https://reviews.llvm.org/D25503#569046, @a.sidorin wrote: > Did you test Artem's approach? I don't think this is necessary, the priority queue looks like "the" data structure to use here. Repository: rL LLVM https://reviews.llvm.org/D255

r284112 - [analyzer] Link libStaticAnalyzerCheckers to libASTMatchers.

2016-10-13 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Thu Oct 13 06:41:12 2016 New Revision: 284112 URL: http://llvm.org/viewvc/llvm-project?rev=284112&view=rev Log: [analyzer] Link libStaticAnalyzerCheckers to libASTMatchers. AST matchers are useful for the analyzer's checkers. More patches on particular checkers shall follo

r319055 - [analyzer] pr34404: Fix a crash on modeling pointers to indirect members.

2017-11-27 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Mon Nov 27 09:31:16 2017 New Revision: 319055 URL: http://llvm.org/viewvc/llvm-project?rev=319055&view=rev Log: [analyzer] pr34404: Fix a crash on modeling pointers to indirect members. We were crashing whenever a C++ pointer-to-member was taken, that was pointing to a mem

r319058 - [analyzer] pr34766: Fix a crash on explicit std::initializer_list constructor.

2017-11-27 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Mon Nov 27 09:37:09 2017 New Revision: 319058 URL: http://llvm.org/viewvc/llvm-project?rev=319058&view=rev Log: [analyzer] pr34766: Fix a crash on explicit std::initializer_list constructor. We didn't support the following syntax: (std::initializer_list){12} which sudd

r319793 - [analyzer] Mark heap-based symbolic regions in debug dumps.

2017-12-05 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Tue Dec 5 09:14:39 2017 New Revision: 319793 URL: http://llvm.org/viewvc/llvm-project?rev=319793&view=rev Log: [analyzer] Mark heap-based symbolic regions in debug dumps. They are now printed as HeapSymRegion{$x} in order to discriminate between that and regular SymRegion

r320451 - [analyzer] In getSVal() API, disable auto-detection of void type as char type.

2017-12-11 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Mon Dec 11 18:27:55 2017 New Revision: 320451 URL: http://llvm.org/viewvc/llvm-project?rev=320451&view=rev Log: [analyzer] In getSVal() API, disable auto-detection of void type as char type. This is a follow-up from r314910. When a checker developer attempts to dereference

r320455 - [analyzer] StackAddrEscape: For now, disable the new async escape checks.

2017-12-11 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Mon Dec 11 18:59:09 2017 New Revision: 320455 URL: http://llvm.org/viewvc/llvm-project?rev=320455&view=rev Log: [analyzer] StackAddrEscape: For now, disable the new async escape checks. The new check introduced in r318705 is useful, but suffers from a particular class of f

[clang] Fix WebKit static analyzers to support ref and deref methods to be defined on different classes. (PR #69985)

2023-11-09 Thread Artem Dergachev via cfe-commits
haoNoQ wrote: LGTM, thanks!! I have a couple nitpicks but I don't think they should block your progress. https://github.com/llvm/llvm-project/pull/69985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/lis

[clang] Fix WebKit static analyzers to support ref and deref methods to be defined on different classes. (PR #69985)

2023-11-09 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ edited https://github.com/llvm/llvm-project/pull/69985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix WebKit static analyzers to support ref and deref methods to be defined on different classes. (PR #69985)

2023-11-09 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ approved this pull request. https://github.com/llvm/llvm-project/pull/69985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix WebKit static analyzers to support ref and deref methods to be defined on different classes. (PR #69985)

2023-11-09 Thread Artem Dergachev via cfe-commits
@@ -77,14 +77,53 @@ class RefCntblBaseVirtualDtorChecker (AccSpec == AS_none && RD->isClass())) return false; - std::optional RefCntblBaseRD = isRefCountable(Base); - if (!RefCntblBaseRD || !(*RefCntblBaseRD)) + auto hasRef

[clang] Fix WebKit static analyzers to support ref and deref methods to be defined on different classes. (PR #69985)

2023-11-09 Thread Artem Dergachev via cfe-commits
@@ -77,14 +77,53 @@ class RefCntblBaseVirtualDtorChecker (AccSpec == AS_none && RD->isClass())) return false; - std::optional RefCntblBaseRD = isRefCountable(Base); - if (!RefCntblBaseRD || !(*RefCntblBaseRD)) + auto hasRef

[clang] Fix WebKit static analyzers to support ref and deref methods to be defined on different classes. (PR #69985)

2023-11-09 Thread Artem Dergachev via cfe-commits
haoNoQ wrote: (You still need me to merge right? You can ask me to merge, or you can address nitpicks and then ask me to merge, or you can go through https://llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access and merge yourself!) https://github.com/llvm/llvm-project/pull/69985 ___

[clang] Fix WebKit static analyzers to support ref and deref methods to be defined on different classes. (PR #69985)

2023-11-10 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ closed https://github.com/llvm/llvm-project/pull/69985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [-Wunsafe-buffer-usage] Add FixableGadget for AddAssign in UnspecifiedUntypedContext (PR #71862)

2023-11-10 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ edited https://github.com/llvm/llvm-project/pull/71862 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [-Wunsafe-buffer-usage] Add FixableGadget for AddAssign in UnspecifiedUntypedContext (PR #71862)

2023-11-10 Thread Artem Dergachev via cfe-commits
@@ -1028,6 +1028,50 @@ class UPCPreIncrementGadget : public FixableGadget { } }; +// Representing a pointer type expression of the form `Ptr += n` in an +// Unspecified Untyped Context (UUC): +class UUCAddAssignGadget : public FixableGadget { +private: + static constexpr co

[clang] [-Wunsafe-buffer-usage] Add FixableGadget for AddAssign in UnspecifiedUntypedContext (PR #71862)

2023-11-10 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ commented: Very nice!! https://github.com/llvm/llvm-project/pull/71862 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [-Wunsafe-buffer-usage] Add FixableGadget for AddAssign in UnspecifiedUntypedContext (PR #71862)

2023-11-13 Thread Artem Dergachev via cfe-commits
@@ -1028,6 +1028,50 @@ class UPCPreIncrementGadget : public FixableGadget { } }; +// Representing a pointer type expression of the form `Ptr += n` in an +// Unspecified Untyped Context (UUC): +class UUCAddAssignGadget : public FixableGadget { +private: + static constexpr co

[clang] [-Wunsafe-buffer-usage] Add FixableGadget for AddAssign in UnspecifiedUntypedContext (PR #71862)

2023-11-13 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ edited https://github.com/llvm/llvm-project/pull/71862 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][CLANG] Fix static analyzer bugs about large copy by values (PR #75060)

2023-12-11 Thread Artem Dergachev via cfe-commits
haoNoQ wrote: Thanks for catching these! I wonder what would it take to delete the copy constructors on these classes, so that these mistakes are never made again. https://github.com/llvm/llvm-project/pull/75060 ___ cfe-commits mailing list cfe-commi

[clang] [NFC][CLANG] Fix static analyzer bugs about large copy by values (PR #75060)

2023-12-11 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ approved this pull request. https://github.com/llvm/llvm-project/pull/75060 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [-Wunsafe-buffer-usage] Add FixableGadget for AddAssign in UnspecifiedUntypedContext (PR #71862)

2023-11-14 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ edited https://github.com/llvm/llvm-project/pull/71862 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [-Wunsafe-buffer-usage] Add FixableGadget for AddAssign in UnspecifiedUntypedContext (PR #71862)

2023-11-14 Thread Artem Dergachev via cfe-commits
@@ -0,0 +1,55 @@ +// RUN: %clang_cc1 -std=c++20 -Wunsafe-buffer-usage \ +// RUN:-fsafe-buffer-usage-suggestions \ +// RUN:-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s +void foo(int * , int *); + +void add_assign_test(unsigned int n, int *a, int y)

[clang] [-Wunsafe-buffer-usage] Add FixableGadget for AddAssign in UnspecifiedUntypedContext (PR #71862)

2023-11-14 Thread Artem Dergachev via cfe-commits
@@ -1766,6 +1815,52 @@ fixUPCAddressofArraySubscriptWithSpan(const UnaryOperator *Node) { FixItHint::CreateReplacement(Node->getSourceRange(), SS.str())}; } +std::optional +UUCAddAssignGadget::getFixits(const Strategy &S) const { + DeclUseList DREs = getClaimedVarUseSi

[clang] [-Wunsafe-buffer-usage] Add FixableGadget for AddAssign in UnspecifiedUntypedContext (PR #71862)

2023-11-14 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ commented: Yay I like this! https://github.com/llvm/llvm-project/pull/71862 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [-Wunsafe-buffer-usage] Add FixableGadget for AddAssign in UnspecifiedUntypedContext (PR #71862)

2023-11-14 Thread Artem Dergachev via cfe-commits
@@ -1312,21 +1353,29 @@ PointerInitGadget::getFixits(const Strategy &S) const { return std::nullopt; } +static bool isNonNegativeIntegerExpr(const Expr *Expr, const VarDecl *VD, + const ASTContext &Ctx) { + if (auto ConstVal = Expr->getIn

[clang] [analyzer] Use AllocaRegion in MallocChecker (PR #72402)

2023-11-15 Thread Artem Dergachev via cfe-commits
haoNoQ wrote: Hmm, it really worries me that `MallocChecker` is setting a return value outside of `evalCall()`. This can easily lead to conflicts if multiple checkers try to do this: `evalCall()` is protected from conflicts (the engine asserts that at most one checker evaluates each call) but

[clang] [analyzer] Use AllocaRegion in MallocChecker (PR #72402)

2023-11-15 Thread Artem Dergachev via cfe-commits
@@ -266,13 +266,18 @@ void CheckUseZeroAllocated1(void) { } char CheckUseZeroAllocated2(void) { + // FIXME: The return value of `alloca()` is modeled with `AllocaRegion` + // instead of `SymbolicRegion`, so the current implementation of + // `MallocChecker::checkUseZeroAllo

[clang] [-Wunsafe-buffer-usage] Add FixableGadget for AddAssign in UnspecifiedUntypedContext (PR #71862)

2023-11-16 Thread Artem Dergachev via cfe-commits
@@ -0,0 +1,55 @@ +// RUN: %clang_cc1 -std=c++20 -Wunsafe-buffer-usage \ +// RUN:-fsafe-buffer-usage-suggestions \ +// RUN:-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s +void foo(int * , int *); + +void add_assign_test(unsigned int n, int *a, int y)

[clang] [-Wunsafe-buffer-usage] Add FixableGadget for AddAssign in UnspecifiedUntypedContext (PR #71862)

2023-11-16 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ commented: Aha, yes, this is exactly what I had in mind with the fix-around-it thing! I found one more nitpick, but I think everything else looks great! https://github.com/llvm/llvm-project/pull/71862 ___ cfe-commits mailing

[clang] [-Wunsafe-buffer-usage] Add FixableGadget for AddAssign in UnspecifiedUntypedContext (PR #71862)

2023-11-16 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ edited https://github.com/llvm/llvm-project/pull/71862 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [-Wunsafe-buffer-usage] Add FixableGadget for AddAssign in UnspecifiedUntypedContext (PR #71862)

2023-11-16 Thread Artem Dergachev via cfe-commits
@@ -1766,6 +1812,48 @@ fixUPCAddressofArraySubscriptWithSpan(const UnaryOperator *Node) { FixItHint::CreateReplacement(Node->getSourceRange(), SS.str())}; } +std::optional +UUCAddAssignGadget::getFixits(const Strategy &S) const { + DeclUseList DREs = getClaimedVarUseSi

[clang] ef3f476 - [attributes][analyzer] Implement [[clang::suppress]] - suppress static analysis warnings.

2023-12-13 Thread Artem Dergachev via cfe-commits
Author: Artem Dergachev Date: 2023-12-13T18:09:16-08:00 New Revision: ef3f476097c7a13c0578e331e44b584b706089ed URL: https://github.com/llvm/llvm-project/commit/ef3f476097c7a13c0578e331e44b584b706089ed DIFF: https://github.com/llvm/llvm-project/commit/ef3f476097c7a13c0578e331e44b584b706089ed.dif

[clang] [-Wunsafe-buffer-usage] Add FixableGadget for AddAssign in UnspecifiedUntypedContext (PR #71862)

2023-11-27 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ approved this pull request. Perfect, thanks!! https://github.com/llvm/llvm-project/pull/71862 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] c8048c7 - [attributes] Generalize attribute 'enforce_tcb' to Objective-C methods.

2022-03-28 Thread Artem Dergachev via cfe-commits
Author: Pierre d'Herbemont Date: 2022-03-28T15:08:47-07:00 New Revision: c8048c7c42ffd1731149b0abe15b9081dd27c789 URL: https://github.com/llvm/llvm-project/commit/c8048c7c42ffd1731149b0abe15b9081dd27c789 DIFF: https://github.com/llvm/llvm-project/commit/c8048c7c42ffd1731149b0abe15b9081dd27c789.

[clang] e0e1748 - [analyzer] Fix a crash in NoStateChangeVisitor with body-farmed stack frames.

2022-02-17 Thread Artem Dergachev via cfe-commits
Author: Artem Dergachev Date: 2022-02-17T10:13:34-08:00 New Revision: e0e174845b08b36a3888f47f6b06e496f75cf847 URL: https://github.com/llvm/llvm-project/commit/e0e174845b08b36a3888f47f6b06e496f75cf847 DIFF: https://github.com/llvm/llvm-project/commit/e0e174845b08b36a3888f47f6b06e496f75cf847.dif

[clang] f68c0a2 - [analyzer] Add path note tags to standard library function summaries.

2022-04-28 Thread Artem Dergachev via cfe-commits
Author: Artem Dergachev Date: 2022-04-28T17:17:05-07:00 New Revision: f68c0a2f58e484f008883ab290e36a36e851c1bf URL: https://github.com/llvm/llvm-project/commit/f68c0a2f58e484f008883ab290e36a36e851c1bf DIFF: https://github.com/llvm/llvm-project/commit/f68c0a2f58e484f008883ab290e36a36e851c1bf.dif

[clang] dd7233b - [Analyzer] Remove extra space from NSErrorChecker message.

2022-05-18 Thread Artem Dergachev via cfe-commits
Author: Usama Hameed Date: 2022-05-18T14:35:12-07:00 New Revision: dd7233bc67e45106c4625df7d20391798f31d4a7 URL: https://github.com/llvm/llvm-project/commit/dd7233bc67e45106c4625df7d20391798f31d4a7 DIFF: https://github.com/llvm/llvm-project/commit/dd7233bc67e45106c4625df7d20391798f31d4a7.diff

[clang] [analyzer] Remove barely used class 'KnownSVal' (NFC) (PR #86953)

2024-03-28 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ approved this pull request. Yeah nuke it. https://github.com/llvm/llvm-project/pull/86953 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix a crash in clang::isGetterOfRefCounted by checking nullptr in tryToFindPtrOrigin (PR #80768)

2024-02-06 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ closed https://github.com/llvm/llvm-project/pull/80768 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add the support for calling Ref::ptr accessor. (PR #80919)

2024-02-09 Thread Artem Dergachev via cfe-commits
@@ -0,0 +1,86 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.webkit.UncountedCallArgsChecker -verify %s +// expected-no-diagnostics + +template +class Ref { haoNoQ wrote: It looks like you're copying this definition in every pull request. Can you put it

[clang] Ignore assignment to Ref / RefPtr in alpha.webkit.UncountedCallArgsChecker. (PR #80810)

2024-02-09 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ approved this pull request. https://github.com/llvm/llvm-project/pull/80810 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add the support for calling Ref::ptr accessor. (PR #80919)

2024-02-09 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ edited https://github.com/llvm/llvm-project/pull/80919 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix an implicit cast to a base ref counted class generates a false positive. (PR #80934)

2024-02-09 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ approved this pull request. https://github.com/llvm/llvm-project/pull/80934 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Allow default arguments to be evaluated like other arguments. (PR #80956)

2024-02-09 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ approved this pull request. https://github.com/llvm/llvm-project/pull/80956 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add the support for calling Ref::ptr accessor. (PR #80919)

2024-02-09 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ approved this pull request. https://github.com/llvm/llvm-project/pull/80919 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Ignore assignment to Ref / RefPtr in alpha.webkit.UncountedCallArgsChecker. (PR #80810)

2024-02-12 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ closed https://github.com/llvm/llvm-project/pull/80810 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add the support for calling Ref::ptr accessor. (PR #80919)

2024-02-12 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ closed https://github.com/llvm/llvm-project/pull/80919 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix an implicit cast to a base ref counted class generates a false positive. (PR #80934)

2024-02-12 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ closed https://github.com/llvm/llvm-project/pull/80934 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Allow default arguments to be evaluated like other arguments. (PR #80956)

2024-02-12 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ closed https://github.com/llvm/llvm-project/pull/80956 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] WebKit checkers: support ref and deref defined on different classes. (PR #68170)

2024-02-13 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ closed https://github.com/llvm/llvm-project/pull/68170 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] WebKit checkers: support ref and deref defined on different classes. (PR #68170)

2024-02-13 Thread Artem Dergachev via cfe-commits
haoNoQ wrote: Closing because of the other PR. https://github.com/llvm/llvm-project/pull/68170 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [attributes][analyzer] Generalize [[clang::suppress]] to declarations. (PR #80371)

2024-02-13 Thread Artem Dergachev via cfe-commits
haoNoQ wrote: Ok I'll try to land! https://github.com/llvm/llvm-project/pull/80371 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [attributes][analyzer] Generalize [[clang::suppress]] to declarations. (PR #80371)

2024-02-13 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ closed https://github.com/llvm/llvm-project/pull/80371 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [-Wunsafe-buffer-usage] Fixits for unsafe arguments of function pointer calls (PR #80358)

2024-02-13 Thread Artem Dergachev via cfe-commits
@@ -282,8 +282,8 @@ isInUnspecifiedPointerContext(internal::Matcher InnerMatcher) { //(i.e., computing the distance between two pointers); or ... auto CallArgMatcher = - callExpr(forEachArgumentWithParam(InnerMatcher, - hasPointerType() /* array

[clang] [alpha.webkit.UncountedCallArgsChecker] Check the safety of the object argument in a member function call. (PR #81400)

2024-02-13 Thread Artem Dergachev via cfe-commits
@@ -70,6 +70,15 @@ class UncountedCallArgsChecker // or std::function call operator). unsigned ArgIdx = isa(CE) && isa_and_nonnull(F); + if (auto *MemberCallExpr = dyn_cast(CE)) { +auto *E = MemberCallExpr->getImplicitObjectArgument(); +auto *

[clang] [alpha.webkit.UncountedCallArgsChecker] Check the safety of the object argument in a member function call. (PR #81400)

2024-02-13 Thread Artem Dergachev via cfe-commits
@@ -183,6 +196,22 @@ class UncountedCallArgsChecker Report->addRange(CallArg->getSourceRange()); BR->emitReport(std::move(Report)); } + + void reportBugOnThis(const Expr *CallArg) const { +assert(CallArg); + +SmallString<100> Buf; +llvm::raw_svector_ostre

[clang] Detect a return value of Ref & RefPtr (PR #81580)

2024-02-13 Thread Artem Dergachev via cfe-commits
@@ -118,6 +118,26 @@ bool isCtorOfRefCounted(const clang::FunctionDecl *F) { || FunctionName == "Identifier"; } +bool isReturnValueRefCounted(const clang::FunctionDecl *F) { + assert(F); + auto *type = F->getReturnType().getTypePtrOrNull(); + while (type) { +if

[clang] [-Wunsafe-buffer-usage] Fixits for unsafe arguments of function pointer calls (PR #80358)

2024-02-13 Thread Artem Dergachev via cfe-commits
@@ -282,8 +282,8 @@ isInUnspecifiedPointerContext(internal::Matcher InnerMatcher) { //(i.e., computing the distance between two pointers); or ... auto CallArgMatcher = - callExpr(forEachArgumentWithParam(InnerMatcher, - hasPointerType() /* array

[clang] [alpha.webkit.UncountedCallArgsChecker] Check the safety of the object argument in a member function call. (PR #81400)

2024-02-13 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ approved this pull request. Great! Needs a rebase now though. https://github.com/llvm/llvm-project/pull/81400 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Detect a return value of Ref & RefPtr (PR #81580)

2024-02-13 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/81580 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [alpha.webkit.UncountedLocalVarsChecker] Allow uncounted object references within trivial statements (PR #82229)

2024-03-06 Thread Artem Dergachev via cfe-commits
@@ -189,18 +202,16 @@ class UncountedLocalVarsChecker dyn_cast_or_null(Ref->getFoundDecl())) { const auto *MaybeGuardianArgType = MaybeGuardian->getType().getTypePtr(); - if (!MaybeGuardianArgType) -return; -

[clang] [alpha.webkit.UncountedLocalVarsChecker] Allow uncounted object references within trivial statements (PR #82229)

2024-03-06 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ edited https://github.com/llvm/llvm-project/pull/82229 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [alpha.webkit.UncountedLocalVarsChecker] Allow uncounted object references within trivial statements (PR #82229)

2024-03-06 Thread Artem Dergachev via cfe-commits
@@ -305,19 +337,21 @@ class TrivialFunctionAnalysisVisitor } bool VisitDeclRefExpr(const DeclRefExpr *DRE) { -if (auto *decl = DRE->getDecl()) { - if (isa(decl)) -return true; - if (isa(decl)) -return true; - if (auto *VD = dyn_cast(decl)

[clang] [alpha.webkit.UncountedLocalVarsChecker] Allow uncounted object references within trivial statements (PR #82229)

2024-03-06 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ approved this pull request. LGTM! I think we have to look at the `DeclRefExpr` case more closely - something seems fishy about it, but also this isn't this patch's fault. https://github.com/llvm/llvm-project/pull/82229 ___ c

[clang] [alpha.webkit.UncountedCallArgsChecker] Don't assume local variables are safe & treat guarded local variable as safe function arguments (PR #82305)

2024-03-07 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ edited https://github.com/llvm/llvm-project/pull/82305 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [alpha.webkit.UncountedCallArgsChecker] Don't assume local variables are safe & treat guarded local variable as safe function arguments (PR #82305)

2024-03-07 Thread Artem Dergachev via cfe-commits
@@ -95,11 +103,136 @@ tryToFindPtrOrigin(const Expr *E, bool StopAtFirstRefCountedObj) { return {E, false}; } +bool isGuardedScopeEmbeddedInGuardianScope(const VarDecl *Guarded, + const VarDecl *MaybeGuardian) { + assert(Guarded);

[clang] [alpha.webkit.UncountedCallArgsChecker] Don't assume local variables are safe & treat guarded local variable as safe function arguments (PR #82305)

2024-03-07 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ commented: Hi, looks like I never got to properly review this one! I don't have major objections but I have some things to consider fixing in follow-up patches. https://github.com/llvm/llvm-project/pull/82305 ___ cfe-commits

[clang] [alpha.webkit.UncountedCallArgsChecker] Don't assume local variables are safe & treat guarded local variable as safe function arguments (PR #82305)

2024-03-07 Thread Artem Dergachev via cfe-commits
@@ -27,6 +28,13 @@ tryToFindPtrOrigin(const Expr *E, bool StopAtFirstRefCountedObj) { E = tempExpr->getSubExpr(); continue; } +if (auto *DRE = dyn_cast(E)) { + auto *decl = DRE->getFoundDecl(); haoNoQ wrote: Is this really better than

[clang] [alpha.webkit.UncountedCallArgsChecker] Don't assume local variables are safe & treat guarded local variable as safe function arguments (PR #82305)

2024-03-07 Thread Artem Dergachev via cfe-commits
haoNoQ wrote: Oh right right right, so it's closed without committing, nvm then! https://github.com/llvm/llvm-project/pull/82305 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [alpha.webkit.UncountedCallArgsChecker] Don't assume local variables are safe & treat guarded local variable as safe function arguments (PR #82305)

2024-03-07 Thread Artem Dergachev via cfe-commits
haoNoQ wrote: I just thought two PRs, accepted 1, then there were 0 left, and I was confused 😅 https://github.com/llvm/llvm-project/pull/82305 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe

[clang] [alpha.webkit.UncountedCallArgsChecker] Allow a variable declaration in a trivial function. (PR #82291)

2024-02-27 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ approved this pull request. LGTM, looks straightforward! https://github.com/llvm/llvm-project/pull/82291 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer]Add C++ polymorphic ptr arithmetic checker (PR #82977)

2024-02-27 Thread Artem Dergachev via cfe-commits
haoNoQ wrote: Hi! I wonder if path-sensitive analysis is useful here at all. If you simply warn every time you see arithmetic performed on a pointer to a class with at least one virtual method, wouldn't that be quite accurate most of the time? At a glance, such operation only makes sense when

[clang] [attributes][analyzer] Generalize [[clang::suppress]] to declarations. (PR #80371)

2024-02-27 Thread Artem Dergachev via cfe-commits
haoNoQ wrote: Yes I like this perspective: "Schrödinger's need-for-pre-commit-approval" isn't a great way to communicate 😅 I'll be more clear in the future. https://github.com/llvm/llvm-project/pull/80371 ___ cfe-commits mailing list cfe-commits@lists

[clang] [alpha.webkit.UncountedLocalVarsChecker] Allow uncounted object references within trivial statements (PR #82229)

2024-02-29 Thread Artem Dergachev via cfe-commits
@@ -171,6 +151,24 @@ class UncountedLocalVarsChecker std::optional IsUncountedPtr = isUncountedPtr(ArgType); if (IsUncountedPtr && *IsUncountedPtr) { + + ASTContext &ctx = V->getASTContext(); + for (DynTypedNodeList ancestors = ctx.getParents(*V); !ancestors.

[clang] [alpha.webkit.UncountedLocalVarsChecker] Allow uncounted object references within trivial statements (PR #82229)

2024-02-29 Thread Artem Dergachev via cfe-commits
@@ -70,15 +71,27 @@ bool isSingleton(const FunctionDecl *F); class TrivialFunctionAnalysis { public: /// \returns true if \p D is a "trivial" function. - bool isTrivial(const Decl *D) const { return isTrivialImpl(D, TheCache); } + bool isTrivial(const Decl *D) const { +

[clang] [alpha.webkit.UncountedLocalVarsChecker] Allow uncounted object references within trivial statements (PR #82229)

2024-02-29 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ edited https://github.com/llvm/llvm-project/pull/82229 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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