https://github.com/balazske closed
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/balazske updated
https://github.com/llvm/llvm-project/pull/79470
From 70eeae8170a782b93b546b81ac913e1b8eacd28e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?=
Date: Thu, 22 Feb 2024 10:18:06 +0100
Subject: [PATCH 1/2] [clang][analyzer] Fix argument
@@ -763,6 +779,11 @@ void StreamChecker::evalFreadFwrite(const FnDescription
*Desc,
return;
}
+ // At read, invalidate the buffer in any case of error or success,
+ // except if EOF was already present.
+ if (IsFread && (OldSS->ErrorState != ErrorFEof))
+State =
@@ -763,6 +779,11 @@ void StreamChecker::evalFreadFwrite(const FnDescription
*Desc,
return;
}
+ // At read, invalidate the buffer in any case of error or success,
+ // except if EOF was already present.
+ if (IsFread && (OldSS->ErrorState != ErrorFEof))
+State =
@@ -763,6 +779,11 @@ void StreamChecker::evalFreadFwrite(const FnDescription
*Desc,
return;
}
+ // At read, invalidate the buffer in any case of error or success,
+ // except if EOF was already present.
+ if (IsFread && (OldSS->ErrorState != ErrorFEof))
+State =
@@ -763,6 +779,11 @@ void StreamChecker::evalFreadFwrite(const FnDescription
*Desc,
return;
}
+ // At read, invalidate the buffer in any case of error or success,
+ // except if EOF was already present.
+ if (IsFread && (OldSS->ErrorState != ErrorFEof))
+State =
balazske wrote:
I have rebased the branch to latest version of `StreamChecker`, no other
changes were made to the patch.
https://github.com/llvm/llvm-project/pull/79470
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://github.com/balazske updated
https://github.com/llvm/llvm-project/pull/79470
From 70eeae8170a782b93b546b81ac913e1b8eacd28e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?=
Date: Thu, 22 Feb 2024 10:18:06 +0100
Subject: [PATCH] [clang][analyzer] Fix argument
https://github.com/balazske 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
@@ -763,6 +779,11 @@ void StreamChecker::evalFreadFwrite(const FnDescription
*Desc,
return;
}
+ // At read, invalidate the buffer in any case of error or success,
+ // except if EOF was already present.
+ if (IsFread && (OldSS->ErrorState != ErrorFEof))
+State =
https://github.com/alejandro-alvarez-sonarsource 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/alejandro-alvarez-sonarsource 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
@@ -763,6 +779,11 @@ void StreamChecker::evalFreadFwrite(const FnDescription
*Desc,
return;
}
+ // At read, invalidate the buffer in any case of error or success,
+ // except if EOF was already present.
+ if (IsFread && (OldSS->ErrorState != ErrorFEof))
+State =
=?utf-8?q?Balázs_Kéri?=
Message-ID:
In-Reply-To:
https://github.com/steakhal approved this pull request.
Thanks for resolving my comments.
FYI if I forget about a PR (that I promise to come back on the next day) - feel
free to ping it or explicitly push the "request review" button.
Wait for
https://github.com/balazske updated
https://github.com/llvm/llvm-project/pull/79470
From dbd9af4e77c34fcf6ce82f226f7dbf836033a8f6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?=
Date: Thu, 25 Jan 2024 17:50:42 +0100
Subject: [PATCH 1/2] [clang][analyzer] Fix argument
@@ -544,6 +545,21 @@ const ExplodedNode
*StreamChecker::getAcquisitionSite(const ExplodedNode *N,
return nullptr;
}
+static ProgramStateRef
+escapeArgs(ProgramStateRef State, CheckerContext , const CallEvent ,
+ const SmallVector ) {
+ const auto *CE =
@@ -544,6 +545,21 @@ const ExplodedNode
*StreamChecker::getAcquisitionSite(const ExplodedNode *N,
return nullptr;
}
+static ProgramStateRef
+escapeArgs(ProgramStateRef State, CheckerContext , const CallEvent ,
+ const SmallVector ) {
+ const auto *CE =
@@ -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
@@ -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
@@ -544,6 +545,21 @@ const ExplodedNode
*StreamChecker::getAcquisitionSite(const ExplodedNode *N,
return nullptr;
}
+static ProgramStateRef
+escapeArgs(ProgramStateRef State, CheckerContext , const CallEvent ,
+ const SmallVector ) {
+ const auto *CE =
@@ -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
@@ -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
@@ -544,6 +545,21 @@ const ExplodedNode
*StreamChecker::getAcquisitionSite(const ExplodedNode *N,
return nullptr;
}
+static ProgramStateRef
+escapeArgs(ProgramStateRef State, CheckerContext , const CallEvent ,
+ const SmallVector ) {
steakhal
@@ -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
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
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
llvmbot wrote:
@llvm/pr-subscribers-clang-static-analyzer-1
Author: Balázs Kéri (balazske)
Changes
Specific arguments passed to stream handling functions are changed by the
function, this means these should be invalidated ("escaped") by the analyzer.
This change adds the argument
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: Balázs Kéri (balazske)
Changes
Specific arguments passed to stream handling functions are changed by the
function, this means these should be invalidated ("escaped") by the analyzer.
This change adds the argument invalidation (in
https://github.com/balazske created
https://github.com/llvm/llvm-project/pull/79470
Specific arguments passed to stream handling functions are changed by the
function, this means these should be invalidated ("escaped") by the analyzer.
This change adds the argument invalidation (in specific
29 matches
Mail list logo