[clang] [clang][analyzer] Fix argument invalidations in StreamChecker. (PR #79470)

2024-01-25 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,133 @@ +// RUN: %clang_analyze_cc1 -verify %s \ +// RUN: -analyzer-checker=core \ +// RUN: -analyzer-checker=alpha.unix.Stream \ +// RUN: -analyzer-checker=debug.StreamTester \ +// RUN: -analyzer-checker=debug.ExprInspection + +#include "Inputs/system-header-simulator.h

[clang] [clang-tools-extra] [llvm] [analyzer] Support interestingness in ArrayBoundV2 (PR #78315)

2024-01-25 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: https://github.com/steakhal commented: > Ouch, that seems to be a nasty issue. Thanks for doing the review and I hope >

[clang-tools-extra] [llvm] [clang] [analyzer] Support interestingness in ArrayBoundV2 (PR #78315)

2024-01-25 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: @@ -221,18 +221,38 @@ int allocaRegion(void) { return *mem; } -int *unknownExtent(int arg) { - if

[clang-tools-extra] [clang] [llvm] [analyzer] Support interestingness in ArrayBoundV2 (PR #78315)

2024-01-25 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/78315 __

[clang] [llvm] [clang-tools-extra] [analyzer] Support interestingness in ArrayBoundV2 (PR #78315)

2024-01-25 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: @@ -245,10 +265,15 @@ int *nothingIsCertain(int x, int y) { if (x >= 2) return 0; int *mem = (

[clang] [clang][analyzer] Add missing stream related functions to StdLibraryFunctionsChecker. (PR #76979)

2024-01-25 Thread Balazs Benics via cfe-commits
=?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= Message-ID: In-Reply-To: @@ -1385,14 +1385,16 @@ Improvements - Improved the ``unix.StdCLibraryFunctions`` checker by modeling more -

[clang] [lldb] [clang-tools-extra] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-26 Thread Balazs Benics via cfe-commits
steakhal wrote: FYI this caused a crash in the Static Analyzer, tracked here: #79575 We will (well, probably I will) look into this to see what could be done about it to workaround/fix the crash for clang-18. https://github.com/llvm/llvm-project/pull/78041 __

[clang-tools-extra] [clang] [clang][NFC] Refactor `CXXNewExpr::InitializationStyle` (re-land) (PR #71417)

2024-01-26 Thread Balazs Benics via cfe-commits
steakhal wrote: Thank you all participating, and especially for @Endilll committing the fix as cc3fd1974696a792ba70ba670ed761937cd0735c. Consider my [issue](https://github.com/llvm/llvm-project/pull/71417#issuecomment-1897925793) resolved. :) https://github.com/llvm/llvm-project/pull/71417 __

[clang] [analyzer] Unbreak [[clang::suppress]] on checkers without decl-with-issue. (PR #79398)

2024-01-26 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. https://github.com/llvm/llvm-project/pull/79398 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Fix argument invalidations in StreamChecker. (PR #79470)

2024-01-26 Thread Balazs Benics via cfe-commits
@@ -544,6 +545,21 @@ const ExplodedNode *StreamChecker::getAcquisitionSite(const ExplodedNode *N, return nullptr; } +static ProgramStateRef +escapeArgs(ProgramStateRef State, CheckerContext &C, const CallEvent &Call, + const SmallVector &EscapingArgs) { + const a

[clang] Fix analyzer crash on 'StructuralValue' (PR #79764)

2024-01-29 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/79764 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix analyzer crash on 'StructuralValue' (PR #79764)

2024-01-29 Thread Balazs Benics via cfe-commits
@@ -40,8 +40,12 @@ static const Expr *ignoreTransparentExprs(const Expr *E) { switch (E->getStmtClass()) { case Stmt::OpaqueValueExprClass: -E = cast(E)->getSourceExpr(); -break; +if (const clang::Expr *SE = cast(E)->getSourceExpr()) { + E = SE; + bre

[clang] Fix analyzer crash on 'StructuralValue' (PR #79764)

2024-01-29 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. Approved with nits. This works around the crash. https://github.com/llvm/llvm-project/pull/79764 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/list

[clang] Fix analyzer crash on 'StructuralValue' (PR #79764)

2024-01-29 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. LGTM for the Static Analyzer. Thanks for fixing this crash. https://github.com/llvm/llvm-project/pull/79764 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

[clang] Fix analyzer crash on 'StructuralValue' (PR #79764)

2024-01-29 Thread Balazs Benics via cfe-commits
@@ -40,8 +40,12 @@ static const Expr *ignoreTransparentExprs(const Expr *E) { switch (E->getStmtClass()) { case Stmt::OpaqueValueExprClass: -E = cast(E)->getSourceExpr(); -break; +if (const clang::Expr *SE = cast(E)->getSourceExpr()) { + E = SE; + bre

[clang] Fix analyzer crash on 'StructuralValue' (PR #79764)

2024-01-29 Thread Balazs Benics via cfe-commits
steakhal wrote: > LGTM for the Static Analyzer. Actually, the other hunk also makes sense. LGTM. https://github.com/llvm/llvm-project/pull/79764 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang] Fix analyzer crash on 'StructuralValue' (PR #79764)

2024-01-30 Thread Balazs Benics via cfe-commits
steakhal wrote: > Thanks! It would be great to get this landed as soon as possible to unbreak > trunk. (I believe we need it for the 18.x branch too?) I'll take care of the backport, after this PR is merged by @bolshakov-a https://github.com/llvm/llvm-project/pull/79764 ___

[clang] Fix analyzer crash on 'StructuralValue' (PR #79764)

2024-01-30 Thread Balazs Benics via cfe-commits
https://github.com/steakhal closed https://github.com/llvm/llvm-project/pull/79764 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix analyzer crash on 'StructuralValue' (PR #79764)

2024-01-30 Thread Balazs Benics via cfe-commits
steakhal wrote: > Thanks! Thanks for the quick workaround! FYI Backport proposed in issue #79992, that refers to PR #79997 actually doing the backport. https://github.com/llvm/llvm-project/pull/79764 ___ cfe-commits mailing list cfe-commits@lists.ll

[clang-tools-extra] [clang] [clang][NFC] Refactor `CXXNewExpr::InitializationStyle` (re-land) (PR #71417)

2024-01-17 Thread Balazs Benics via cfe-commits
steakhal wrote: The commit _"[clang][NFC] Refactor `CXXNewExpr::InitializationStyle` (re-land) (#71417)"_ https://github.com/llvm/llvm-project/commit/e929f0694aeb5f8cdbd2369db6189d28bb6fbcf3 appears to be a functional change, as it has a side effect on the following test code: ```diff diff -

[clang] [clang-tools-extra] [clang][NFC] Refactor `CXXNewExpr::InitializationStyle` (re-land) (PR #71417)

2024-01-18 Thread Balazs Benics via cfe-commits
steakhal wrote: > Please let us know if this change is disruptive to you though, thanks! I'm not really well versed about c++ initialization, so I asked my collage @tomasz-kaminski-sonarsource, to double-check how `CXXNewExpr` initialization is done per standard. I'll try to summarize what we

[clang] [analyzer] Demonstrate superfluous unsigned >= 0 assumption (PR #78442)

2024-01-19 Thread Balazs Benics via cfe-commits
steakhal wrote: I'd advise against introducing a separate file for this, but I'm okay with landing tests. Given this issue, I'd be interested to look at how difficult it is to actually fix it and commit the case along with the fix. Have you looked at potential solutions? https://github.com/llv

[clang] [analyzer] Support interestingness in ArrayBoundV2 (PR #78315)

2024-01-19 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/78315 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Support interestingness in ArrayBoundV2 (PR #78315)

2024-01-19 Thread Balazs Benics via cfe-commits
@@ -318,17 +396,87 @@ static Messages getTaintMsgs(const SubRegion *Region, const char *OffsetName) { RegName, OffsetName)}; } -void ArrayBoundCheckerV2::performCheck(const Expr *E, CheckerContext &C) const { - // NOTE: Instead of using ProgramState::assum

[clang] [analyzer] Support interestingness in ArrayBoundV2 (PR #78315)

2024-01-19 Thread Balazs Benics via cfe-commits
https://github.com/steakhal commented: I only scrolled through the patch. But I find it pretty good. I still need to go over the message construction and the tests along with it, and also to look for more logic bugs. https://github.com/llvm/llvm-project/pull/78315 __

[clang] [analyzer] Support interestingness in ArrayBoundV2 (PR #78315)

2024-01-19 Thread Balazs Benics via cfe-commits
@@ -133,12 +195,19 @@ computeOffset(ProgramStateRef State, SValBuilder &SVB, SVal Location) { return std::nullopt; } -// TODO: once the constraint manager is smart enough to handle non simplified -// symbolic expressions remove this function. Note that this can not be used

[clang] [analyzer] Support interestingness in ArrayBoundV2 (PR #78315)

2024-01-19 Thread Balazs Benics via cfe-commits
@@ -318,17 +396,87 @@ static Messages getTaintMsgs(const SubRegion *Region, const char *OffsetName) { RegName, OffsetName)}; } -void ArrayBoundCheckerV2::performCheck(const Expr *E, CheckerContext &C) const { - // NOTE: Instead of using ProgramState::assum

[clang] [analyzer] Support interestingness in ArrayBoundV2 (PR #78315)

2024-01-19 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,128 @@ +// RUN: %clang_analyze_cc1 -Wno-array-bounds -analyzer-output=text\ +// RUN: -analyzer-checker=core,alpha.security.ArrayBoundV2,unix.Malloc,alpha.security.taint,debug.ExprInspection -verify %s + +int array[10]; + +void clang_analyzer_value(unsigned

[clang] [analyzer] Support interestingness in ArrayBoundV2 (PR #78315)

2024-01-19 Thread Balazs Benics via cfe-commits
@@ -318,17 +396,87 @@ static Messages getTaintMsgs(const SubRegion *Region, const char *OffsetName) { RegName, OffsetName)}; } -void ArrayBoundCheckerV2::performCheck(const Expr *E, CheckerContext &C) const { - // NOTE: Instead of using ProgramState::assum

[clang] [analyzer] Support interestingness in ArrayBoundV2 (PR #78315)

2024-01-19 Thread Balazs Benics via cfe-commits
@@ -33,7 +33,66 @@ using namespace taint; using llvm::formatv; namespace { -enum OOB_Kind { OOB_Precedes, OOB_Exceeds, OOB_Taint }; +class StateUpdateReporter { + const SubRegion *Reg; + NonLoc ByteOffsetVal; + std::optional ElementType = std::nullopt; + std::optional Elem

[clang] [analyzer] Support interestingness in ArrayBoundV2 (PR #78315)

2024-01-19 Thread Balazs Benics via cfe-commits
@@ -350,6 +498,10 @@ void ArrayBoundCheckerV2::performCheck(const Expr *E, CheckerContext &C) const { auto [Reg, ByteOffset] = *RawOffset; + // The state updates will be reported as a single note tag, which will be + // composed by this helper class. + StateUpdateReport

[clang] [analyzer] Support interestingness in ArrayBoundV2 (PR #78315)

2024-01-19 Thread Balazs Benics via cfe-commits
@@ -33,7 +33,66 @@ using namespace taint; using llvm::formatv; namespace { -enum OOB_Kind { OOB_Precedes, OOB_Exceeds, OOB_Taint }; +class StateUpdateReporter { + const SubRegion *Reg; + NonLoc ByteOffsetVal; + std::optional ElementType = std::nullopt; + std::optional Elem

[clang] [analyzer] Support interestingness in ArrayBoundV2 (PR #78315)

2024-01-19 Thread Balazs Benics via cfe-commits
@@ -255,7 +319,28 @@ static Messages getPrecedesMsgs(const SubRegion *Region, NonLoc Offset) { Out << "Access of " << RegName << " at negative byte offset"; if (auto ConcreteIdx = Offset.getAs()) Out << ' ' << ConcreteIdx->getValue(); - return {getShortMsg(OOB_Precede

[clang] [analyzer] Support interestingness in ArrayBoundV2 (PR #78315)

2024-01-19 Thread Balazs Benics via cfe-commits
@@ -318,17 +396,87 @@ static Messages getTaintMsgs(const SubRegion *Region, const char *OffsetName) { RegName, OffsetName)}; } -void ArrayBoundCheckerV2::performCheck(const Expr *E, CheckerContext &C) const { - // NOTE: Instead of using ProgramState::assum

[clang] [analyzer] Support interestingness in ArrayBoundV2 (PR #78315)

2024-01-19 Thread Balazs Benics via cfe-commits
@@ -33,7 +33,66 @@ using namespace taint; using llvm::formatv; namespace { -enum OOB_Kind { OOB_Precedes, OOB_Exceeds, OOB_Taint }; +class StateUpdateReporter { + const SubRegion *Reg; + NonLoc ByteOffsetVal; + std::optional ElementType = std::nullopt; + std::optional Elem

[clang] [analyzer] Support interestingness in ArrayBoundV2 (PR #78315)

2024-01-19 Thread Balazs Benics via cfe-commits
@@ -381,66 +542,98 @@ void ArrayBoundCheckerV2::performCheck(const Expr *E, CheckerContext &C) const { compareValueToThreshold(State, ByteOffset, *KnownSize, SVB); if (ExceedsUpperBound) { + // The offset may be invalid (>= Size)... if (!WithinUpperBou

[clang] [analyzer] Support interestingness in ArrayBoundV2 (PR #78315)

2024-01-19 Thread Balazs Benics via cfe-commits
@@ -133,12 +195,19 @@ computeOffset(ProgramStateRef State, SValBuilder &SVB, SVal Location) { return std::nullopt; } -// TODO: once the constraint manager is smart enough to handle non simplified -// symbolic expressions remove this function. Note that this can not be used

[clang] [analyzer] Support interestingness in ArrayBoundV2 (PR #78315)

2024-01-19 Thread Balazs Benics via cfe-commits
@@ -318,17 +396,87 @@ static Messages getTaintMsgs(const SubRegion *Region, const char *OffsetName) { RegName, OffsetName)}; } -void ArrayBoundCheckerV2::performCheck(const Expr *E, CheckerContext &C) const { - // NOTE: Instead of using ProgramState::assum

[clang] [clang][analyzer][NFC] Simplify ranges in StdLibraryFunctionsChecker (PR #78886)

2024-01-21 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/78886 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Add function 'fscanf' to StreamChecker. (PR #78180)

2024-01-22 Thread Balazs Benics via cfe-commits
=?utf-8?q?Balázs_Kéri?= Message-ID: In-Reply-To: steakhal wrote: This patch breaks a downstream test, like this: ```c++ void test_fscanf_2() { FILE *F1 = tmpfile(); if (!F1) return; int a; unsigned b; fscanf(F1, "%d %u", &a, &b); clang_analyzer_dump_int(a); // FP warning: 1st

[clang] [clang][analyzer] Improve modeling of 'execv' and 'execvp' in StdLibraryFunctionsChecker (PR #78930)

2024-01-22 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/78930 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [llvm] [clang] [analyzer] Support interestingness in ArrayBoundV2 (PR #78315)

2024-01-22 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: steakhal wrote: > @steakhal I handled all the suggestions from the first review round (either > by updating the PR, or by replying / asking follo

[clang] [clang][analyzer] Add function 'ungetc' to StreamChecker. (PR #77331)

2024-01-23 Thread Balazs Benics via cfe-commits
=?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= Message-ID: In-Reply-To: @@ -916,6 +922,45 @@ void StreamChecker::evalFputx(const FnDescription *Desc, const CallEvent &Call, C.addTransition(StateFailed); } +void StreamChecker::evalUngetc(const FnDescription *Desc, cons

[clang] [clang][analyzer] Add function 'ungetc' to StreamChecker. (PR #77331)

2024-01-23 Thread Balazs Benics via cfe-commits
=?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= Message-ID: In-Reply-To: @@ -916,6 +922,45 @@ void StreamChecker::evalFputx(const FnDescription *Desc, const CallEvent &Call, C.addTransition(StateFailed); } +void StreamChecker::evalUngetc(const FnDescription *Desc, cons

[clang] [analyzer][NFC] Simplifications in ArrayBoundV2 (PR #67572)

2023-10-19 Thread Balazs Benics via cfe-commits
=?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy Message-ID: In-Reply-To: https://github.com/steakhal approved this pull request. No blocking comments. https://github.com/llvm/llvm-project/pull/67572 ___ cfe-commits mailing list cfe-commits

[clang] [analyzer][NFC] Simplifications in ArrayBoundV2 (PR #67572)

2023-10-19 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/67572 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman

[clang] [analyzer][NFC] Simplifications in ArrayBoundV2 (PR #67572)

2023-10-19 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: @@ -32,42 +32,72 @@ using namespace taint; namespace { class ArrayBoundCheckerV2 : public Checker { - mutable std::unique_ptr BT; - mutable std::unique_ptr TaintBT; + BugType BT{this, "Out-of-bou

[clang] [analyzer][NFC] Simplifications in ArrayBoundV2 (PR #67572)

2023-10-19 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: @@ -32,42 +32,72 @@ using namespace taint; namespace { class ArrayBoundCheckerV2 : public Checker { - mutable std::unique_ptr BT; - mutable std::unique_ptr TaintBT; + BugType BT{this, "Out-of-bou

[clang-tools-extra] [analyzer] Add std::variant checker (PR #66481)

2023-10-19 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/66481 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Add std::variant checker (PR #66481)

2023-10-19 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,104 @@ +//===- TaggedUnionModeling.h -*- C++ -*-==// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [analyzer] Add std::variant checker (PR #66481)

2023-10-19 Thread Balazs Benics via cfe-commits
@@ -318,6 +318,10 @@ def C11LockChecker : Checker<"C11Lock">, Dependencies<[PthreadLockBase]>, Documentation; +def StdVariantChecker : Checker<"StdVariant">, + HelpText<"Check for bad type access for std::variant.">, + Documentation; + steakhal wrote: T

[clang-tools-extra] [analyzer] Add std::variant checker (PR #66481)

2023-10-19 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,104 @@ +//===- TaggedUnionModeling.h -*- C++ -*-==// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [analyzer] Add std::variant checker (PR #66481)

2023-10-19 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,104 @@ +//===- TaggedUnionModeling.h -*- C++ -*-==// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [analyzer] Add std::variant checker (PR #66481)

2023-10-19 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,104 @@ +//===- TaggedUnionModeling.h -*- C++ -*-==// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [analyzer] Add std::variant checker (PR #66481)

2023-10-19 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,327 @@ +//===- StdVariantChecker.cpp -*- C++ -*-==// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [analyzer] Add std::variant checker (PR #66481)

2023-10-19 Thread Balazs Benics via cfe-commits
https://github.com/steakhal requested changes to this pull request. I had a quick look once again. This this time I focused on the library boundaries and APIs. https://github.com/llvm/llvm-project/pull/66481 ___ cfe-commits mailing list cfe-commits@lis

[clang] [analyzer] Add std::variant checker (PR #66481)

2023-10-19 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,104 @@ +//===- TaggedUnionModeling.h -*- C++ -*-==// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [analyzer] Add std::variant checker (PR #66481)

2023-10-19 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,327 @@ +//===- StdVariantChecker.cpp -*- C++ -*-==// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [analyzer] Add std::variant checker (PR #66481)

2023-10-19 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,104 @@ +//===- TaggedUnionModeling.h -*- C++ -*-==// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [analyzer] Add std::variant checker (PR #66481)

2023-10-19 Thread Balazs Benics via cfe-commits
https://github.com/steakhal requested changes to this pull request. I had a quick look once again. This this time I focused on the library boundaries and APIs. https://github.com/llvm/llvm-project/pull/66481 ___ cfe-commits mailing list cfe-commits@lis

[clang] [analyzer][NFC] Substitute operator() with lambda in StreamChecker (PR #69844)

2023-10-21 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/69844 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer][NFC] Substitute operator() with lambda in StreamChecker (PR #69844)

2023-10-21 Thread Balazs Benics via cfe-commits
@@ -407,23 +407,15 @@ class StreamChecker : public Checker std::string { + if (BR.isInteresting(StreamSym) && + &BR.getBugType() == &(this->BT_ResourceLeak)) steakhal wrote: ```suggestion &BR.getBugType() == &BT_ResourceLeak) `

[clang] [analyzer][NFC] Substitute operator() with lambda in StreamChecker (PR #69844)

2023-10-21 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. Thanks. https://github.com/llvm/llvm-project/pull/69844 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer][NFC] Substitute operator() with lambda in StreamChecker (PR #69844)

2023-10-21 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. https://github.com/llvm/llvm-project/pull/69844 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer][NFC] Substitute operator() with lambda in StreamChecker (PR #69844)

2023-10-21 Thread Balazs Benics via cfe-commits
https://github.com/steakhal closed https://github.com/llvm/llvm-project/pull/69844 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer][NFC] Simplifications in ArrayBoundV2 (PR #67572)

2023-10-22 Thread Balazs Benics via cfe-commits
=?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy Message-ID: In-Reply-To: https://github.com/steakhal approved this pull request. https://github.com/llvm/llvm-project/pull/67572 __

[clang] [analyzer] Add std::variant checker (PR #66481)

2023-10-22 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,104 @@ +//===- TaggedUnionModeling.h -*- C++ -*-==// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [analyzer] Add std::variant checker (PR #66481)

2023-10-22 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,104 @@ +//===- TaggedUnionModeling.h -*- C++ -*-==// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [analyzer] Add std::variant checker (PR #66481)

2023-10-22 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,104 @@ +//===- TaggedUnionModeling.h -*- C++ -*-==// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [analyzer] Add std::variant checker (PR #66481)

2023-10-22 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,104 @@ +//===- TaggedUnionModeling.h -*- C++ -*-==// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [analyzer] Loop should contain CXXForRangeStmt (PR #70190)

2023-10-25 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. Thanks https://github.com/llvm/llvm-project/pull/70190 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 1638636 - [analyzer] Evaluate PredefinedExpressions

2020-09-13 Thread Balazs Benics via cfe-commits
Author: Balazs Benics Date: 2020-09-14T08:43:56+02:00 New Revision: 163863604f9c1ad3add238f9e8fb32cfd136f894 URL: https://github.com/llvm/llvm-project/commit/163863604f9c1ad3add238f9e8fb32cfd136f894 DIFF: https://github.com/llvm/llvm-project/commit/163863604f9c1ad3add238f9e8fb32cfd136f894.diff

[clang] cdacffe - [analyzer][z3] Use more elaborate Z3 variable names

2020-09-13 Thread Balazs Benics via cfe-commits
Author: Balazs Benics Date: 2020-09-14T08:43:56+02:00 New Revision: cdacffe4acc083dfb1cccb6458420eed09f9d093 URL: https://github.com/llvm/llvm-project/commit/cdacffe4acc083dfb1cccb6458420eed09f9d093 DIFF: https://github.com/llvm/llvm-project/commit/cdacffe4acc083dfb1cccb6458420eed09f9d093.diff

[clang] aa0dc1c - [analyzer][NFCi] Mark CallEvent::getOriginExpr virtual, some cleanup

2020-11-06 Thread Balazs Benics via cfe-commits
Author: Balazs Benics Date: 2020-11-06T16:51:34+01:00 New Revision: aa0dc1c3b8628bed8c8b91a75258d13eefa88dfe URL: https://github.com/llvm/llvm-project/commit/aa0dc1c3b8628bed8c8b91a75258d13eefa88dfe DIFF: https://github.com/llvm/llvm-project/commit/aa0dc1c3b8628bed8c8b91a75258d13eefa88dfe.diff

[clang] ee073c7 - [analyzer][StdLibraryFunctionsChecker] Fix typos in summaries of mmap and mmap64

2020-11-30 Thread Balazs Benics via cfe-commits
Author: Balazs Benics Date: 2020-11-30T18:06:28+01:00 New Revision: ee073c798515e56b23463391a7b40d5ee6527337 URL: https://github.com/llvm/llvm-project/commit/ee073c798515e56b23463391a7b40d5ee6527337 DIFF: https://github.com/llvm/llvm-project/commit/ee073c798515e56b23463391a7b40d5ee6527337.diff

[clang] ebcf030 - [analyzer] Engine: fix crash with SEH __leave keyword

2021-05-17 Thread Balazs Benics via cfe-commits
Author: Abbas Sabra Date: 2021-05-17T20:10:26+02:00 New Revision: ebcf030efc5ef149e423f8fa2ca705b590a129ed URL: https://github.com/llvm/llvm-project/commit/ebcf030efc5ef149e423f8fa2ca705b590a129ed DIFF: https://github.com/llvm/llvm-project/commit/ebcf030efc5ef149e423f8fa2ca705b590a129ed.diff L

[clang] 88ee91c - [ASTimporter] Remove decl from lookup only if it has decl context

2021-05-18 Thread Balazs Benics via cfe-commits
Author: Balazs Benics Date: 2021-05-18T09:43:20+02:00 New Revision: 88ee91cd87794813f4394f82d2c693c8d766e1d2 URL: https://github.com/llvm/llvm-project/commit/88ee91cd87794813f4394f82d2c693c8d766e1d2 DIFF: https://github.com/llvm/llvm-project/commit/88ee91cd87794813f4394f82d2c693c8d766e1d2.diff

[clang] 3febf0b - [analyzer][Z3][NFC] Use GTEST_SKIP instead of hacks

2021-05-21 Thread Balazs Benics via cfe-commits
Author: Balazs Benics Date: 2021-05-21T11:35:24+02:00 New Revision: 3febf0b507e6257414d92744fd646840aa38e5d2 URL: https://github.com/llvm/llvm-project/commit/3febf0b507e6257414d92744fd646840aa38e5d2 DIFF: https://github.com/llvm/llvm-project/commit/3febf0b507e6257414d92744fd646840aa38e5d2.diff

[clang] 058f384 - [analyzer] Correctly propagate ConstructionContextLayer thru ParenExpr

2021-05-24 Thread Balazs Benics via cfe-commits
Author: Tomasz Kamiński Date: 2021-05-24T10:16:52+02:00 New Revision: 058f384ae94ae0ac94441043804e4a25d338d483 URL: https://github.com/llvm/llvm-project/commit/058f384ae94ae0ac94441043804e4a25d338d483 DIFF: https://github.com/llvm/llvm-project/commit/058f384ae94ae0ac94441043804e4a25d338d483.dif

[clang] db8af0f - [analyzer][ctu] Avoid parsing invocation list again and again during on-demand parsing of CTU

2021-05-25 Thread Balazs Benics via cfe-commits
Author: Ella Ma Date: 2021-05-25T09:19:14+02:00 New Revision: db8af0f21dc9aad4d336754c857c24470afe53e3 URL: https://github.com/llvm/llvm-project/commit/db8af0f21dc9aad4d336754c857c24470afe53e3 DIFF: https://github.com/llvm/llvm-project/commit/db8af0f21dc9aad4d336754c857c24470afe53e3.diff LOG:

[clang] f05b70c - Revert "[analyzer][ctu] Avoid parsing invocation list again and again during on-demand parsing of CTU"

2021-05-25 Thread Balazs Benics via cfe-commits
Author: Balazs Benics Date: 2021-05-25T09:29:56+02:00 New Revision: f05b70c23687fdf3de349ab1dd99ad79c4c40e85 URL: https://github.com/llvm/llvm-project/commit/f05b70c23687fdf3de349ab1dd99ad79c4c40e85 DIFF: https://github.com/llvm/llvm-project/commit/f05b70c23687fdf3de349ab1dd99ad79c4c40e85.diff

[clang] d59b4ac - [analyzer][ctu] Reland "Avoid parsing invocation list again and again..

2021-05-25 Thread Balazs Benics via cfe-commits
Author: Ella Ma Date: 2021-05-25T09:44:13+02:00 New Revision: d59b4acf80d59c461decd41400988febaf0af8ca URL: https://github.com/llvm/llvm-project/commit/d59b4acf80d59c461decd41400988febaf0af8ca DIFF: https://github.com/llvm/llvm-project/commit/d59b4acf80d59c461decd41400988febaf0af8ca.diff LOG:

[clang] 66d9d10 - [clang][AST] Add support for ShuffleVectorExpr to ASTImporter

2021-09-27 Thread Balazs Benics via cfe-commits
Author: Balazs Benics Date: 2021-09-27T10:17:12+02:00 New Revision: 66d9d1012b031e7f7559e8f0e03b9e7bfb6c20a1 URL: https://github.com/llvm/llvm-project/commit/66d9d1012b031e7f7559e8f0e03b9e7bfb6c20a1 DIFF: https://github.com/llvm/llvm-project/commit/66d9d1012b031e7f7559e8f0e03b9e7bfb6c20a1.diff

[clang] e5e0e00 - [NFC] Cleanup the overload of ASTImporter::import()

2021-09-30 Thread Balazs Benics via cfe-commits
Author: Balazs Benics Date: 2021-09-30T11:53:08+02:00 New Revision: e5e0e00831ba093639edbd443b6e05b3118f8930 URL: https://github.com/llvm/llvm-project/commit/e5e0e00831ba093639edbd443b6e05b3118f8930 DIFF: https://github.com/llvm/llvm-project/commit/e5e0e00831ba093639edbd443b6e05b3118f8930.diff

[clang] a3d0b58 - [analyzer] Fix deprecated plistlib functions

2021-10-01 Thread Balazs Benics via cfe-commits
Author: Manas Date: 2021-10-01T17:07:24+02:00 New Revision: a3d0b5805e5ff2fd870df5be5c3197eee0bb74a0 URL: https://github.com/llvm/llvm-project/commit/a3d0b5805e5ff2fd870df5be5c3197eee0bb74a0 DIFF: https://github.com/llvm/llvm-project/commit/a3d0b5805e5ff2fd870df5be5c3197eee0bb74a0.diff LOG: [a

[clang] 6e30710 - [analyzer] Introduce MacroExpansionContext to libAnalysis

2021-02-22 Thread Balazs Benics via cfe-commits
Author: Balazs Benics Date: 2021-02-22T11:11:57+01:00 New Revision: 6e3071007b4c9438d2ae49476de87db30d6d24e9 URL: https://github.com/llvm/llvm-project/commit/6e3071007b4c9438d2ae49476de87db30d6d24e9 DIFF: https://github.com/llvm/llvm-project/commit/6e3071007b4c9438d2ae49476de87db30d6d24e9.diff

[clang] 7c58fb6 - [analyzer] Create MacroExpansionContext member in AnalysisConsumer

2021-02-22 Thread Balazs Benics via cfe-commits
Author: Balazs Benics Date: 2021-02-22T11:12:14+01:00 New Revision: 7c58fb6ba04e28e594587bb27f13849cc1f2d305 URL: https://github.com/llvm/llvm-project/commit/7c58fb6ba04e28e594587bb27f13849cc1f2d305 DIFF: https://github.com/llvm/llvm-project/commit/7c58fb6ba04e28e594587bb27f13849cc1f2d305.diff

[clang] 38b1858 - [analyzer][CTU] API for CTU macro expansions

2021-02-22 Thread Balazs Benics via cfe-commits
Author: Balazs Benics Date: 2021-02-22T11:12:22+01:00 New Revision: 38b185832e04ed0588c43161f5c3a8c0ce267497 URL: https://github.com/llvm/llvm-project/commit/38b185832e04ed0588c43161f5c3a8c0ce267497 DIFF: https://github.com/llvm/llvm-project/commit/38b185832e04ed0588c43161f5c3a8c0ce267497.diff

[clang] 3dae019 - [analyzer] Make CheckerManager::hasPathSensitiveCheckers() complete again

2021-06-29 Thread Balazs Benics via cfe-commits
Author: Balazs Benics Date: 2021-06-29T16:35:07+02:00 New Revision: 3dae01911b6902f00e80eb7ebdc2f55bb28f173e URL: https://github.com/llvm/llvm-project/commit/3dae01911b6902f00e80eb7ebdc2f55bb28f173e DIFF: https://github.com/llvm/llvm-project/commit/3dae01911b6902f00e80eb7ebdc2f55bb28f173e.diff

[clang] aa454dd - [analyzer] LValueToRValueBitCasts should evaluate to an r-value

2021-07-01 Thread Balazs Benics via cfe-commits
Author: Balazs Benics Date: 2021-07-01T10:54:22+02:00 New Revision: aa454dda2eed4e71081bc57b1f32dfce2486b177 URL: https://github.com/llvm/llvm-project/commit/aa454dda2eed4e71081bc57b1f32dfce2486b177 DIFF: https://github.com/llvm/llvm-project/commit/aa454dda2eed4e71081bc57b1f32dfce2486b177.diff

[clang] 55662b2 - [analyzer][NFC] Inline ExprEngine::handleLVectorSplat()

2021-07-01 Thread Balazs Benics via cfe-commits
Author: Balazs Benics Date: 2021-07-01T10:54:28+02:00 New Revision: 55662b24a4755680e4fd34dc22a3dd555fdb1291 URL: https://github.com/llvm/llvm-project/commit/55662b24a4755680e4fd34dc22a3dd555fdb1291 DIFF: https://github.com/llvm/llvm-project/commit/55662b24a4755680e4fd34dc22a3dd555fdb1291.diff

[clang] d3e14fa - [analyzer][NFC] Display the correct function name even in crash dumps

2021-07-11 Thread Balazs Benics via cfe-commits
Author: Balazs Benics Date: 2021-07-12T09:06:46+02:00 New Revision: d3e14fafc69a07e3dab9ddb91f1d810bb5f8d7a0 URL: https://github.com/llvm/llvm-project/commit/d3e14fafc69a07e3dab9ddb91f1d810bb5f8d7a0 DIFF: https://github.com/llvm/llvm-project/commit/d3e14fafc69a07e3dab9ddb91f1d810bb5f8d7a0.diff

[clang] c184072 - [analyzer] Fix StringChecker for Unknown params

2021-10-26 Thread Balazs Benics via cfe-commits
Author: Balazs Benics Date: 2021-10-26T18:15:00+02:00 New Revision: c18407217e91abea73555e07956d7132dd093bd2 URL: https://github.com/llvm/llvm-project/commit/c18407217e91abea73555e07956d7132dd093bd2 DIFF: https://github.com/llvm/llvm-project/commit/c18407217e91abea73555e07956d7132dd093bd2.diff

[clang] 49285f4 - [analyzer] sprintf is a taint propagator not a source

2021-10-28 Thread Balazs Benics via cfe-commits
Author: Balazs Benics Date: 2021-10-28T11:03:02+02:00 New Revision: 49285f43e5ed17206235e43c9cd17762d77ed275 URL: https://github.com/llvm/llvm-project/commit/49285f43e5ed17206235e43c9cd17762d77ed275 DIFF: https://github.com/llvm/llvm-project/commit/49285f43e5ed17206235e43c9cd17762d77ed275.diff

[clang] 9b5c9c4 - [analyzer] Dump checker name if multiple checkers evaluate the same call

2021-11-02 Thread Balazs Benics via cfe-commits
Author: Balazs Benics Date: 2021-11-02T14:42:14+01:00 New Revision: 9b5c9c469d90227251d9da9108ee7985ba415f2b URL: https://github.com/llvm/llvm-project/commit/9b5c9c469d90227251d9da9108ee7985ba415f2b DIFF: https://github.com/llvm/llvm-project/commit/9b5c9c469d90227251d9da9108ee7985ba415f2b.diff

[clang] 57e149d - [analyzer][docs][NFC] Fix typo in checkers.rst

2021-03-10 Thread Balazs Benics via cfe-commits
Author: Balazs Benics Date: 2021-03-10T12:42:23+01:00 New Revision: 57e149d386286031e0fd118acf162056ce9d4795 URL: https://github.com/llvm/llvm-project/commit/57e149d386286031e0fd118acf162056ce9d4795 DIFF: https://github.com/llvm/llvm-project/commit/57e149d386286031e0fd118acf162056ce9d4795.diff

[clang] 0dc0e2a - [analyzer][NFC] Add more tests for ArrayBoundCheckerV2

2021-03-10 Thread Balazs Benics via cfe-commits
Author: Balazs Benics Date: 2021-03-10T12:42:23+01:00 New Revision: 0dc0e2a9ab3cc6be3d4012ea861f54e69854472d URL: https://github.com/llvm/llvm-project/commit/0dc0e2a9ab3cc6be3d4012ea861f54e69854472d DIFF: https://github.com/llvm/llvm-project/commit/0dc0e2a9ab3cc6be3d4012ea861f54e69854472d.diff

[clang] 0e0ea9f - [analyzer][CTU][NFC] Add an extra regression test

2021-03-10 Thread Balazs Benics via cfe-commits
Author: Balazs Benics Date: 2021-03-10T12:42:24+01:00 New Revision: 0e0ea9ffb8027b2e785b383d66b06bbd92dc7a46 URL: https://github.com/llvm/llvm-project/commit/0e0ea9ffb8027b2e785b383d66b06bbd92dc7a46 DIFF: https://github.com/llvm/llvm-project/commit/0e0ea9ffb8027b2e785b383d66b06bbd92dc7a46.diff

[clang] bcc6624 - [analyzer] Crash fix for alpha.cplusplus.IteratorRange

2021-03-10 Thread Balazs Benics via cfe-commits
Author: Adam Balogh Date: 2021-03-10T12:42:24+01:00 New Revision: bcc662484a95c95f7d193e6a791fc5d1c4a2c74f URL: https://github.com/llvm/llvm-project/commit/bcc662484a95c95f7d193e6a791fc5d1c4a2c74f DIFF: https://github.com/llvm/llvm-project/commit/bcc662484a95c95f7d193e6a791fc5d1c4a2c74f.diff L

[clang] a94ac46 - [analyzer][CTU][NFC] Fix "Add an extra regression test"

2021-03-10 Thread Balazs Benics via cfe-commits
Author: Balazs Benics Date: 2021-03-10T13:07:49+01:00 New Revision: a94ac467c2974d9afe68f3fe6cff27bd19bcfad0 URL: https://github.com/llvm/llvm-project/commit/a94ac467c2974d9afe68f3fe6cff27bd19bcfad0 DIFF: https://github.com/llvm/llvm-project/commit/a94ac467c2974d9afe68f3fe6cff27bd19bcfad0.diff

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