https://github.com/steakhal closed
https://github.com/llvm/llvm-project/pull/84963
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
steakhal wrote:
Merged to main as e48d5a838f69e0a8e0ae95a8aed1a8809f45465a
https://github.com/llvm/llvm-project/pull/84963
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -565,37 +565,67 @@ til::SExpr *SExprBuilder::translateBinaryOperator(const
BinaryOperator *BO,
case BO_PtrMemI:
return new (Arena) til::Undefined(BO);
- case BO_Mul: return translateBinOp(til::BOP_Mul, BO, Ctx);
- case BO_Div: return translateBinOp(til::BOP_Div,
https://github.com/steakhal edited
https://github.com/llvm/llvm-project/pull/82599
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -535,7 +545,8 @@ void CFNumberChecker::checkPreStmt(const CallExpr *CE,
}
//===--===//
-// CFRetain/CFRelease/CFMakeCollectable/CFAutorelease checking for null
arguments.
+// CFRetain/CFRelease/CFMakeColl
@@ -18,37 +18,57 @@ using namespace til;
StringRef til::getUnaryOpcodeString(TIL_UnaryOpcode Op) {
switch (Op) {
-case UOP_Minus:return "-";
-case UOP_BitNot: return "~";
-case UOP_LogicNot: return "!";
+ case UOP_Minus:
+return "-";
+ case UOP_BitNot
@@ -380,27 +376,41 @@ enum CFNumberType {
};
static std::optional GetCFNumberSize(ASTContext &Ctx, uint64_t i) {
- static const unsigned char FixedSize[] = { 8, 16, 32, 64, 32, 64 };
+ static const unsigned char FixedSize[] = {8, 16, 32, 64, 32, 64};
if (i < kCFNumberCh
@@ -33,30 +33,17 @@ namespace ento {
/// checking.
///
/// \sa CheckerContext
-class CheckerDocumentation : public Checker< check::PreStmt,
- check::PostStmt,
- check::PreObjCMessage,
-
@@ -244,24 +246,25 @@ void WalkAST::VisitCallExpr(CallExpr *CE) {
if (containsBadStrlcpyStrlcatPattern(CE)) {
const Expr *DstArg = CE->getArg(0);
const Expr *LenArg = CE->getArg(2);
- PathDiagnosticLocation Loc =
-PathDiagnosticLocation::createBegin
https://github.com/steakhal commented:
Yeey, my review is done.
We only have a handful (<50) debatable formatting problems.
I'll try to fix them in an other PR.
https://github.com/llvm/llvm-project/pull/82599
___
cfe-commits mailing list
cfe-commits@l
@@ -1,4 +1,5 @@
-//===-- SimpleStreamChecker.cpp -*-
C++ -*--//
+//===-- SimpleStreamChecker.cpp -*- C++
+//-*--//
steakhal wrote:
```suggestion
//===-- SimpleStreamChecker.cpp -
@@ -49,54 +50,44 @@ const char *IsARPBind = "isautoreleasepoolbind";
class ObjCAutoreleaseWriteChecker : public Checker {
public:
- void checkASTCodeBody(const Decl *D,
-AnalysisManager &AM,
+ void checkASTCodeBody(const Decl *D, AnalysisManager &AM,
@@ -110,21 +111,41 @@ void ExprEngine::VisitBinaryOperator(const
BinaryOperator* B,
continue;
}
-assert (B->isCompoundAssignmentOp());
+assert(B->isCompoundAssignmentOp());
switch (Op) {
- default:
-llvm_unreachable("Invalid opcode for co
@@ -219,17 +219,19 @@ void WalkAST::VisitCallExpr(CallExpr *CE) {
if (containsBadStrncatPattern(CE)) {
const Expr *DstArg = CE->getArg(0);
const Expr *LenArg = CE->getArg(2);
- PathDiagnosticLocation Loc =
-PathDiagnosticLocation::createBegin(LenArg
@@ -1,4 +1,5 @@
-//=- DirectIvarAssignment.cpp - Check rules on ObjC properties -*- C++
*-==//
+//=- DirectIvarAssignment.cpp - Check rules on ObjC properties -*- C++
+//*-==//
steakhal wrote:
Bad formatting.
```suggestion
//=- DirectIvarAssignment.cpp -
@@ -1,4 +1,5 @@
-//===-- STLAlgorithmModeling.cpp ---*- C++
-*--//
+//===-- STLAlgorithmModeling.cpp ---*- C++
+//-*--//
steakhal wrote:
```suggestion
//===-- STLAlgorithmModeling.cpp --
@@ -33,30 +33,17 @@ namespace ento {
/// checking.
///
/// \sa CheckerContext
-class CheckerDocumentation : public Checker< check::PreStmt,
- check::PostStmt,
- check::PreObjCMessage,
-
https://github.com/steakhal created
https://github.com/llvm/llvm-project/pull/82919
clang-format would format these headers poorly by splitting it into multiple
lines.
```regex
//=.{78,}
```
>From 319329630e0d2a86b22dd435985026ea236f8e56 Mon Sep 17 00:00:00 2001
From: Balazs Benics
Date: Sun
https://github.com/steakhal created
https://github.com/llvm/llvm-project/pull/82920
None
>From fd85686af33570f0baf8ba60a0b0b8113e999c4a Mon Sep 17 00:00:00 2001
From: Balazs Benics
Date: Sun, 25 Feb 2024 12:37:49 +0100
Subject: [PATCH] [clang][NFC] Prefer usings over typedefs
---
.../clang/A
https://github.com/steakhal created
https://github.com/llvm/llvm-project/pull/82921
This is the followup PR for #82599 to fix the cases where clang-format would
regress the flow of the code.
>From 245de9ea5c33649ff7b3e359cd360361d4dc5ae3 Mon Sep 17 00:00:00 2001
From: Balazs Benics
Date: Sun,
steakhal wrote:
I've submitted PRs to resolve the pending formatting issues.
https://github.com/llvm/llvm-project/pull/82599
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
steakhal wrote:
> (In case you do intend to merge changes related to formatting, consider
> adding the resulting commit hash into the blame-ignore file.)
I dont intend to merge this.
https://github.com/llvm/llvm-project/pull/82599
___
cfe-commits mai
https://github.com/steakhal closed
https://github.com/llvm/llvm-project/pull/82920
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Alejandro =?utf-8?q?Álvarez_Ayllón?=,
Alejandro =?utf-8?q?Álvarez_Ayllón?=,
Alejandro =?utf-8?q?Álvarez_Ayllón?=,
Alejandro =?utf-8?q?Álvarez_Ayllón?=,
Alejandro =?utf-8?q?Álvarez_Ayllón?=,
Alejandro =?utf-8?q?Álvarez_Ayllón?=,
Alejandro =?utf-8?q?Álvarez_Ayllón?=,
Alejandro =?utf-8?q?Álvarez_Aylló
Alejandro =?utf-8?q?Álvarez_Ayllón?=,
Alejandro =?utf-8?q?Álvarez_Ayllón?=,
Alejandro =?utf-8?q?Álvarez_Ayllón?=,
Alejandro =?utf-8?q?Álvarez_Ayllón?=,
Alejandro =?utf-8?q?Álvarez_Ayllón?=,
Alejandro =?utf-8?q?Álvarez_Ayllón?=,
Alejandro =?utf-8?q?Álvarez_Ayllón?=,
Alejandro =?utf-8?q?Álvarez_Aylló
Author: Balazs Benics
Date: 2024-02-28T14:10:22+01:00
New Revision: 570bc5d291f92e19f6264262b02ddff1a2f2e09b
URL:
https://github.com/llvm/llvm-project/commit/570bc5d291f92e19f6264262b02ddff1a2f2e09b
DIFF:
https://github.com/llvm/llvm-project/commit/570bc5d291f92e19f6264262b02ddff1a2f2e09b.diff
steakhal wrote:
Makes sense, but how did it build before the fix?
I thought by inheriting from `Checker` it would take the address of the member
function with the expected signature to store them inside vectors. How could it
take the address of a nonexisting member function?
https://github.com
https://github.com/steakhal approved this pull request.
https://github.com/llvm/llvm-project/pull/83677
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/steakhal edited
https://github.com/llvm/llvm-project/pull/83585
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/steakhal edited
https://github.com/llvm/llvm-project/pull/83585
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,15 @@
+// RUN: %clang_analyze_cc1 -analyzer-checker=core.DivideZero -std=c++23
-verify %s
+// expected-no-diagnostics
+
+struct S
+{
+constexpr auto operator==(this auto, S)
+{
+return true;
+}
+};
+
+int main()
+{
+return S {} == S {};
+}
-
https://github.com/steakhal commented:
I feel like it's better than crashing, but I suspect it only resolves that,
right?
https://github.com/llvm/llvm-project/pull/83585
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cg
@@ -0,0 +1,15 @@
+// RUN: %clang_analyze_cc1 -analyzer-checker=core.DivideZero -std=c++23
-verify %s
steakhal wrote:
```suggestion
// RUN: %clang_analyze_cc1 -analyzer-checker=core -std=c++23 -verify %s
```
https://github.com/llvm/llvm-project/pull/83585
__
@@ -0,0 +1,15 @@
+// RUN: %clang_analyze_cc1 -analyzer-checker=core.DivideZero -std=c++23
-verify %s
+// expected-no-diagnostics
+
+struct S
+{
+constexpr auto operator==(this auto, S)
+{
+return true;
+}
+};
+
+int main()
+{
+return S {} == S {};
+}
-
https://github.com/steakhal created
https://github.com/llvm/llvm-project/pull/83968
None
>From 3a7f862398a5168028f2d3d66d6b8986e7d528da Mon Sep 17 00:00:00 2001
From: Balazs Benics
Date: Tue, 5 Mar 2024 08:47:56 +0100
Subject: [PATCH] [analyzer][NFC] Remove dead code
---
.../StaticAnalyzer/C
steakhal wrote:
Please merge it once approved.
https://github.com/llvm/llvm-project/pull/83968
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
steakhal wrote:
> +1 to @pogo59's comment about pruning complete paths - I suspect they're in
> the minority. Might be worth checking whether the `===` at the start and end
> is markup for any particular thing (I /think/ the `-*- C++ -*-` is load
> bearing for some editors to inform them this
steakhal wrote:
I did some grepping.
Inside the `clang` project:
`^/+=(.*)/(.*)...$`: 297 files
`^/+=([^\n/]*)\.(h|cpp)([^\n/]*)...$`: 1766 files
This suggests to me that indeed, absolute paths are the used way fewer times.
https://github.com/llvm/llvm-project/pull/82919
___
https://github.com/steakhal created
https://github.com/llvm/llvm-project/pull/83973
In PR #83677 I was surprised to see that outdated checker callback signatures
are a problem. It turns out, we need the `registerChecker...` function to
invoke the `Mgr.registerChecker<>()` which would instantia
https://github.com/steakhal requested changes to this pull request.
Thanks for the PR!
At first I was hesitant if this checker is the right place for this API.
But actually, it should be fine to have it here.
Maybe the stdlibraryfunctionschecker would be a better place in long term, but
I don't
https://github.com/steakhal edited
https://github.com/llvm/llvm-project/pull/83675
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -2516,6 +2518,47 @@ void CStringChecker::evalSprintfCommon(CheckerContext
&C, const CallEvent &Call,
C.addTransition(State);
}
+void CStringChecker::evalGetentropy(CheckerContext &C,
+const CallEvent &Call) const {
+ DestinationArgExp
@@ -2516,6 +2518,47 @@ void CStringChecker::evalSprintfCommon(CheckerContext
&C, const CallEvent &Call,
C.addTransition(State);
}
+void CStringChecker::evalGetentropy(CheckerContext &C,
+const CallEvent &Call) const {
+ DestinationArgExp
@@ -2516,6 +2518,47 @@ void CStringChecker::evalSprintfCommon(CheckerContext
&C, const CallEvent &Call,
C.addTransition(State);
}
+void CStringChecker::evalGetentropy(CheckerContext &C,
+const CallEvent &Call) const {
+ DestinationArgExp
@@ -2516,6 +2518,47 @@ void CStringChecker::evalSprintfCommon(CheckerContext
&C, const CallEvent &Call,
C.addTransition(State);
}
+void CStringChecker::evalGetentropy(CheckerContext &C,
+const CallEvent &Call) const {
+ DestinationArgExp
https://github.com/steakhal edited
https://github.com/llvm/llvm-project/pull/83973
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
steakhal wrote:
> LGTM.
>
> Minor remark: "signatires" is misspelled in the commit message.
Fixed the typos. Thanks!
https://github.com/llvm/llvm-project/pull/83973
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bi
https://github.com/steakhal closed
https://github.com/llvm/llvm-project/pull/83973
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
steakhal wrote:
I'm fine with the change.
https://github.com/llvm/llvm-project/pull/83985
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
=?utf-8?q?Balázs_Kéri?=
Message-ID:
In-Reply-To:
@@ -3020,44 +3020,82 @@ Check for misuses of stream APIs. Check for misuses of
stream APIs: ``fopen, fcl
alpha.unix.Stream (C)
"
-Check stream handling functions: ``fopen, tmpfile, fclose, fread, fwrite,
https://github.com/steakhal created
https://github.com/llvm/llvm-project/pull/80456
See the MS docs:
https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/using-the--analysis-assume-function-to-suppress-false-defects
https://learn.microsoft.com/en-us/cpp/code-quality/how-to-specif
steakhal wrote:
Let me know if this is correct @Xazax-hun. You probably have more insights on
these APIs than me ;)
https://github.com/llvm/llvm-project/pull/80456
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/
https://github.com/steakhal updated
https://github.com/llvm/llvm-project/pull/80456
>From 9065aec18b5b9c4d922b0650e709e71ed31b5a45 Mon Sep 17 00:00:00 2001
From: Balazs Benics
Date: Fri, 2 Feb 2024 16:24:21 +0100
Subject: [PATCH 1/2] [analyzer] Teach analzer about ms __analyzer_assume(bool)
an
steakhal wrote:
> The code LGTM with some minor remarks. (Disclaimer: I'm not familiar with
> these MS functions.)
>
> I'm not sure whether these "builtin by Microsoft" functions are in scope for
> "our" BuiltinFunctionChecker which previously only checked functions that are
> recognized as `
https://github.com/steakhal updated
https://github.com/llvm/llvm-project/pull/80456
>From 3a11db7ce1e91daacb86e183e7137db7a6101c9b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lo=C3=AFc=20Joly?=
Date: Tue, 9 Aug 2022 23:21:18 +0200
Subject: [PATCH] [analyzer] Model Microsoft "__assume" in the same
https://github.com/steakhal edited
https://github.com/llvm/llvm-project/pull/80456
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
steakhal wrote:
It turns out we already had a downstream patch, so I'll drop this one in favor
of what we already had.
Sorry about the confusion.
This version is already in production for many years now.
https://github.com/llvm/llvm-project/pull/80456
___
steakhal wrote:
Thanks Donát!
I'll wait for @Xazax-hun explicit approval to be sure everyone on board (who
left remarks) are okay with the current content.
https://github.com/llvm/llvm-project/pull/80456
___
cfe-commits mailing list
cfe-commits@lists
=?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 ,
=?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 ,
=?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 ,
=?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 ,
=?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 ,
=?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 ,
=?utf-8?q?Don=C3=A1t?= Nagy ,
=?utf-8?q?Don=C3=A1t?= 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 ,
=?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 ,
=?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 ,
=?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 ,
=?utf-8?q?Donát?= Nagy ,
=?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 ,
=?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 ,
=?utf-8?q?Don=C3=A1t?= Nagy ,
=?utf-8?q?Don=C3=A1t?= Nagy ,
Author: Loïc Joly
Date: 2024-02-05T17:02:24+01:00
New Revision: ae354c5a45d319b3117c2822b8f6988461f3cb33
URL:
https://github.com/llvm/llvm-project/commit/ae354c5a45d319b3117c2822b8f6988461f3cb33
DIFF:
https://github.com/llvm/llvm-project/commit/ae354c5a45d319b3117c2822b8f6988461f3cb33.diff
LOG
steakhal wrote:
Pushed manually to preserve the patch author.
(I believe, "squash&merge" would overwrite it.)
Merged as ae354c5a45d319b3117c2822b8f6988461f3cb33.
https://github.com/llvm/llvm-project/pull/80456
___
cfe-commits mailing list
cfe-commits@
https://github.com/steakhal closed
https://github.com/llvm/llvm-project/pull/80456
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
steakhal wrote:
I'm excited to see this change.
I've not reviewed this yet.
https://github.com/llvm/llvm-project/pull/80457
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -778,42 +781,61 @@ void StreamChecker::evalFgetc(const FnDescription *Desc,
const CallEvent &Call,
assertStreamStateOpened(OldSS);
steakhal wrote:
This patch caused a downstream test failure.
Here is the fix:
```suggestion
// We don't model the buffer
https://github.com/steakhal edited
https://github.com/llvm/llvm-project/pull/73638
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -926,6 +932,49 @@ void StreamChecker::evalFputx(const FnDescription *Desc,
const CallEvent &Call,
C.addTransition(StateFailed);
}
+void StreamChecker::evalFprintf(const FnDescription *Desc,
+const CallEvent &Call,
+
=?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_in
https://github.com/steakhal edited
https://github.com/llvm/llvm-project/pull/77613
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -778,42 +781,61 @@ void StreamChecker::evalFgetc(const FnDescription *Desc,
const CallEvent &Call,
assertStreamStateOpened(OldSS);
steakhal wrote:
At first glance you should be right. However, when I tried it, it didn't break
any tests but this one.
I p
https://github.com/steakhal edited
https://github.com/llvm/llvm-project/pull/73638
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -778,42 +781,61 @@ void StreamChecker::evalFgetc(const FnDescription *Desc,
const CallEvent &Call,
assertStreamStateOpened(OldSS);
steakhal wrote:
The problem should apply to all APIs that potentially write to the passed
buffer; including `fread` too.
steakhal wrote:
I'm yet to review the PR, but I would express my opinion on the ergonomics of
the StreamChecker, as I've spent the last couple of days around it.
I find code duplication less harmful than unnatural generalization over small
set of functions (I know, it's a hot take :D).
`std::b
https://github.com/steakhal approved this pull request.
LGTM
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
https://github.com/steakhal requested changes to this pull request.
https://github.com/llvm/llvm-project/pull/78895
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/steakhal edited
https://github.com/llvm/llvm-project/pull/78895
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -2211,6 +2221,15 @@ void StdLibraryFunctionsChecker::initFunctionSummaries(
ErrnoNEZeroIrrelevant, GenericFailureMsg)
.ArgConstraint(NotNull(ArgNo(0;
+// int pclose(FILE *stream);
+addToFunctionSummaryMap(
+"pclose", Signatu
@@ -2211,6 +2221,15 @@ void StdLibraryFunctionsChecker::initFunctionSummaries(
ErrnoNEZeroIrrelevant, GenericFailureMsg)
.ArgConstraint(NotNull(ArgNo(0;
+// int pclose(FILE *stream);
+addToFunctionSummaryMap(
+"pclose", Signatu
https://github.com/steakhal approved this pull request.
https://github.com/llvm/llvm-project/pull/78895
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/steakhal commented:
I only have minor nits. No objections.
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
@@ -27,6 +28,8 @@ class PathDiagnosticLocation;
class BugSuppression {
public:
+ BugSuppression(ASTContext &ACtx) : ACtx(ACtx) {}
steakhal wrote:
```suggestion
explicit BugSuppression(const ASTContext &ACtx) : ACtx(ACtx) {}
```
https://github.com/llvm/llv
@@ -44,7 +47,9 @@ class BugSuppression {
using CachedRanges =
llvm::SmallVector;
- llvm::DenseMap CachedSuppressionLocations;
+ llvm::DenseMap CachedSuppressionLocations{};
+
+ ASTContext &ACtx;
steakhal wrote:
```suggestion
llvm::DenseMap Cached
https://github.com/steakhal edited
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
steakhal wrote:
> I'm seconding the suggestions of @steakhal, and in particular I agree with
>
> > I'd also advise against using more callables bundled with CallDescriptions.
> > They make debugging code more difficult, as the control-flow would become
> > also data-dependent. I'd suggest othe
steakhal wrote:
When is it possible to have an empty range set as a constraint?
https://github.com/llvm/llvm-project/pull/79446
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/steakhal edited
https://github.com/llvm/llvm-project/pull/79446
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -3270,8 +3270,12 @@ void RangeConstraintManager::printJson(raw_ostream &Out,
ProgramStateRef State,
void RangeConstraintManager::printValue(raw_ostream &Out, ProgramStateRef
State,
SymbolRef Sym) {
const RangeSet RS = getRange(Stat
https://github.com/steakhal requested changes to this pull request.
https://github.com/llvm/llvm-project/pull/79446
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/steakhal approved this pull request.
https://github.com/llvm/llvm-project/pull/79446
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/steakhal edited
https://github.com/llvm/llvm-project/pull/79470
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/steakhal commented:
I like what you do in this patch.
I only have a couple nits. That's it.
Tomorrow, I'll check if there are any other APIs that we should test; but seems
complete at first glance.
https://github.com/llvm/llvm-project/pull/79470
_
@@ -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
@@ -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) {
--
@@ -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
@@ -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
@@ -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
401 - 500 of 2518 matches
Mail list logo