Hi,
I am aware of the problem, there should be already a commit to (hopefully)
correct the failure.
Balázs Kéri
Galina Kistanova ezt írta (időpont: 2018. júl. 11.,
Sze, 20:01):
> Hello Balazs,
>
> This commit broke at least one of our builders:
>
> http://lab.llvm.org:8011/builders/llvm-clang-x
Author: Balázs Kéri
Date: 2020-05-20T09:40:57+02:00
New Revision: f7c9f77ef3721c956499b0ccf5e585de105aae4e
URL:
https://github.com/llvm/llvm-project/commit/f7c9f77ef3721c956499b0ccf5e585de105aae4e
DIFF:
https://github.com/llvm/llvm-project/commit/f7c9f77ef3721c956499b0ccf5e585de105aae4e.diff
L
Author: Balázs Kéri
Date: 2020-05-28T08:21:57+02:00
New Revision: 9081fa20991d101728434b354a96283b26495b71
URL:
https://github.com/llvm/llvm-project/commit/9081fa20991d101728434b354a96283b26495b71
DIFF:
https://github.com/llvm/llvm-project/commit/9081fa20991d101728434b354a96283b26495b71.diff
L
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG9b7c43d341da: [Analyzer][StreamChecker] Report every leak,
clean up state. (authored by balazske).
Changed prior to commit:
https://reviews.llvm.o
Author: Balázs Kéri
Date: 2020-07-20T11:49:00+02:00
New Revision: 9b7c43d341da319c69b11205ee1deb642f286e59
URL:
https://github.com/llvm/llvm-project/commit/9b7c43d341da319c69b11205ee1deb642f286e59
DIFF:
https://github.com/llvm/llvm-project/commit/9b7c43d341da319c69b11205ee1deb642f286e59.diff
L
Author: Balázs Kéri
Date: 2020-07-23T11:53:25+02:00
New Revision: 65fd651980a8ad965363807cc334c513e4c8ffe4
URL:
https://github.com/llvm/llvm-project/commit/65fd651980a8ad965363807cc334c513e4c8ffe4
DIFF:
https://github.com/llvm/llvm-project/commit/65fd651980a8ad965363807cc334c513e4c8ffe4.diff
L
Author: Balázs Kéri
Date: 2020-07-30T08:33:12+02:00
New Revision: b22b97b3d0c08485d478073d6a2a6e769af7a2af
URL:
https://github.com/llvm/llvm-project/commit/b22b97b3d0c08485d478073d6a2a6e769af7a2af
DIFF:
https://github.com/llvm/llvm-project/commit/b22b97b3d0c08485d478073d6a2a6e769af7a2af.diff
L
Author: Balázs Kéri
Date: 2020-07-30T09:52:28+02:00
New Revision: 1745ba41b196d80d8a6739dffcbb6f613d371f29
URL:
https://github.com/llvm/llvm-project/commit/1745ba41b196d80d8a6739dffcbb6f613d371f29
DIFF:
https://github.com/llvm/llvm-project/commit/1745ba41b196d80d8a6739dffcbb6f613d371f29.diff
L
Author: Balázs Kéri
Date: 2020-04-08T11:30:19+02:00
New Revision: 11bd3e5c6549a4983be454ccfbeb16e88c9532db
URL:
https://github.com/llvm/llvm-project/commit/11bd3e5c6549a4983be454ccfbeb16e88c9532db
DIFF:
https://github.com/llvm/llvm-project/commit/11bd3e5c6549a4983be454ccfbeb16e88c9532db.diff
L
Author: Balázs Kéri
Date: 2020-04-14T10:26:51+02:00
New Revision: 37ac1c19bed7b7d22e9312dfa61e7a4506ed4e49
URL:
https://github.com/llvm/llvm-project/commit/37ac1c19bed7b7d22e9312dfa61e7a4506ed4e49
DIFF:
https://github.com/llvm/llvm-project/commit/37ac1c19bed7b7d22e9312dfa61e7a4506ed4e49.diff
L
Author: Balázs Kéri
Date: 2020-04-14T12:35:28+02:00
New Revision: f2b5e60dfd09f99d036197c078179c774f8b4582
URL:
https://github.com/llvm/llvm-project/commit/f2b5e60dfd09f99d036197c078179c774f8b4582
DIFF:
https://github.com/llvm/llvm-project/commit/f2b5e60dfd09f99d036197c078179c774f8b4582.diff
L
Author: Balázs Kéri
Date: 2020-06-04T16:06:07+02:00
New Revision: 0bfd70bdad7e4ac22d96503fa78a5dd55d4b430e
URL:
https://github.com/llvm/llvm-project/commit/0bfd70bdad7e4ac22d96503fa78a5dd55d4b430e
DIFF:
https://github.com/llvm/llvm-project/commit/0bfd70bdad7e4ac22d96503fa78a5dd55d4b430e.diff
L
Author: Balázs Kéri
Date: 2020-06-15T15:43:23+02:00
New Revision: efa8b6e884aa4c3ad74ab44489352c0f80ac9741
URL:
https://github.com/llvm/llvm-project/commit/efa8b6e884aa4c3ad74ab44489352c0f80ac9741
DIFF:
https://github.com/llvm/llvm-project/commit/efa8b6e884aa4c3ad74ab44489352c0f80ac9741.diff
L
Author: Balázs Kéri
Date: 2020-07-07T16:24:24+02:00
New Revision: 85f5d1261c9a3f0abc4ae370005a1127174f2ce1
URL:
https://github.com/llvm/llvm-project/commit/85f5d1261c9a3f0abc4ae370005a1127174f2ce1
DIFF:
https://github.com/llvm/llvm-project/commit/85f5d1261c9a3f0abc4ae370005a1127174f2ce1.diff
L
Author: Balázs Kéri
Date: 2020-07-15T12:19:25+02:00
New Revision: 22a084cfa337d5e5ea90eba5261f7937e28d250b
URL:
https://github.com/llvm/llvm-project/commit/22a084cfa337d5e5ea90eba5261f7937e28d250b
DIFF:
https://github.com/llvm/llvm-project/commit/22a084cfa337d5e5ea90eba5261f7937e28d250b.diff
L
Author: Balázs Kéri
Date: 2020-06-22T11:15:35+02:00
New Revision: e935a540ea29d5de297595801aed1fb70fabfbf6
URL:
https://github.com/llvm/llvm-project/commit/e935a540ea29d5de297595801aed1fb70fabfbf6
DIFF:
https://github.com/llvm/llvm-project/commit/e935a540ea29d5de297595801aed1fb70fabfbf6.diff
L
Author: Balázs Kéri
Date: 2020-06-29T15:37:13+02:00
New Revision: d1df56023132914b877e34f6cf475758a96540f2
URL:
https://github.com/llvm/llvm-project/commit/d1df56023132914b877e34f6cf475758a96540f2
DIFF:
https://github.com/llvm/llvm-project/commit/d1df56023132914b877e34f6cf475758a96540f2.diff
L
Author: Balázs Kéri
Date: 2020-07-01T09:13:05+02:00
New Revision: f3b34466104877b024e168cac054bded6b9279a0
URL:
https://github.com/llvm/llvm-project/commit/f3b34466104877b024e168cac054bded6b9279a0
DIFF:
https://github.com/llvm/llvm-project/commit/f3b34466104877b024e168cac054bded6b9279a0.diff
L
Author: Balázs Kéri
Date: 2020-04-27T12:36:26+02:00
New Revision: 3b9b3d56efaa6f611458899d5a1cdc74f36d72a4
URL:
https://github.com/llvm/llvm-project/commit/3b9b3d56efaa6f611458899d5a1cdc74f36d72a4
DIFF:
https://github.com/llvm/llvm-project/commit/3b9b3d56efaa6f611458899d5a1cdc74f36d72a4.diff
L
Author: Balázs Kéri
Date: 2020-08-11T10:10:13+02:00
New Revision: 497d060d0a741e13dd5e6218ba7301a7ec96f332
URL:
https://github.com/llvm/llvm-project/commit/497d060d0a741e13dd5e6218ba7301a7ec96f332
DIFF:
https://github.com/llvm/llvm-project/commit/497d060d0a741e13dd5e6218ba7301a7ec96f332.diff
L
Author: Balázs Kéri
Date: 2020-05-14T14:30:05+02:00
New Revision: cb1eeb42c03c31d4dadd00dbaec693e6d7516099
URL:
https://github.com/llvm/llvm-project/commit/cb1eeb42c03c31d4dadd00dbaec693e6d7516099
DIFF:
https://github.com/llvm/llvm-project/commit/cb1eeb42c03c31d4dadd00dbaec693e6d7516099.diff
L
Author: Balázs Kéri
Date: 2020-05-18T16:18:59+02:00
New Revision: 22d40cc3a724fa3df259c52009571a21a3a3a632
URL:
https://github.com/llvm/llvm-project/commit/22d40cc3a724fa3df259c52009571a21a3a3a632
DIFF:
https://github.com/llvm/llvm-project/commit/22d40cc3a724fa3df259c52009571a21a3a3a632.diff
L
Author: Balázs Kéri
Date: 2020-05-18T17:14:39+02:00
New Revision: 1907f28b47cfe9c951df43309d121679895b0edf
URL:
https://github.com/llvm/llvm-project/commit/1907f28b47cfe9c951df43309d121679895b0edf
DIFF:
https://github.com/llvm/llvm-project/commit/1907f28b47cfe9c951df43309d121679895b0edf.diff
L
Author: Balázs Kéri
Date: 2020-05-19T09:44:46+02:00
New Revision: 51bb2128ef03985fddf2a84f17d3276f4ae2c6ad
URL:
https://github.com/llvm/llvm-project/commit/51bb2128ef03985fddf2a84f17d3276f4ae2c6ad
DIFF:
https://github.com/llvm/llvm-project/commit/51bb2128ef03985fddf2a84f17d3276f4ae2c6ad.diff
L
Author: Balázs Kéri
Date: 2020-05-19T12:12:28+02:00
New Revision: 56079e1de1129837aa7569d8b3bb5e50afc0f1ea
URL:
https://github.com/llvm/llvm-project/commit/56079e1de1129837aa7569d8b3bb5e50afc0f1ea
DIFF:
https://github.com/llvm/llvm-project/commit/56079e1de1129837aa7569d8b3bb5e50afc0f1ea.diff
L
Author: Balázs Kéri
Date: 2022-09-01T09:05:59+02:00
New Revision: d56a1c68247751e94c4fc46dda282643d3739689
URL:
https://github.com/llvm/llvm-project/commit/d56a1c68247751e94c4fc46dda282643d3739689
DIFF:
https://github.com/llvm/llvm-project/commit/d56a1c68247751e94c4fc46dda282643d3739689.diff
L
https://github.com/balazske created
https://github.com/llvm/llvm-project/pull/71392
The checker now displays one combined note tag for errno-related and
"case"-related notes. Previous functions in the errno-modeling part that were
used for construction of note tags are removed. The note tag ad
balazske wrote:
PRs #71373 and #71392 are created to improve the indicated problems.
https://github.com/llvm/llvm-project/pull/69469
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/balazske requested changes to this pull request.
https://github.com/llvm/llvm-project/pull/71394
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -639,12 +644,7 @@ void StreamChecker::preFreadFwrite(const FnDescription
*Desc,
bool IsFread) const {
ProgramStateRef State = C.getState();
SVal StreamVal = getStreamArg(Desc, Call);
- State = ensureStreamNonNull(StreamVal, Call.getAr
@@ -342,6 +342,11 @@ class StreamChecker : public Checkerhttps://github.com/llvm/llvm-project/pull/71394
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/balazske edited
https://github.com/llvm/llvm-project/pull/71394
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -639,12 +644,7 @@ void StreamChecker::preFreadFwrite(const FnDescription
*Desc,
bool IsFread) const {
ProgramStateRef State = C.getState();
SVal StreamVal = getStreamArg(Desc, Call);
- State = ensureStreamNonNull(StreamVal, Call.getAr
balazske wrote:
With the current code it is a corner case if this change makes the code more
readable. Probably it can be useful if new functions are added to the checker.
But the rule here is that there is one "ensure" function to check one aspect of
the state, and the pre-callbacks call all
balazske wrote:
This change looks not very useful to me. These removed return statements
indicate that at the end of the `if` branch there is no more work to do in this
function, and it reduces complexity (less execution paths). The code becomes a
bit shorter but not necessarily more easy to u
https://github.com/balazske approved this pull request.
https://github.com/llvm/llvm-project/pull/71394
___
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/71392
From e92bf72fc80bb6823996cb71cb811d238b304aaa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?=
Date: Thu, 2 Nov 2023 18:12:32 +0100
Subject: [PATCH 1/2] [clang][analyzer] Improve 'errno' handli
https://github.com/balazske updated
https://github.com/llvm/llvm-project/pull/71373
From 653aeb7f5b0d0f200b3f706bad770a9be643669c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?=
Date: Fri, 3 Nov 2023 09:48:18 +0100
Subject: [PATCH 1/2] [clang][analyzer] Improve StdLibraryFunc
https://github.com/balazske requested changes to this pull request.
https://github.com/llvm/llvm-project/pull/71518
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -268,3 +285,41 @@ void error_indeterminate_feof2(void) {
}
fclose(F);
}
+
+void error_indeterminate_feof3(void) {
+ FILE *F = fopen("file", "r+");
+ if (!F)
+return;
+ char Buf[10];
+ if (fread(Buf, 1, 10, F) < 10) {
+if (feof(F)) {
+ // error is feof, s
https://github.com/balazske edited
https://github.com/llvm/llvm-project/pull/71518
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -111,6 +117,14 @@ void f_use_after_close(void) {
clearerr(p); // expected-warning {{Stream might be already closed}}
}
+void f_write_after_close(void) {
balazske wrote:
This is not needed if the other indicated test is added.
https://github.com/llvm/llv
@@ -14,6 +14,12 @@ void check_fwrite(void) {
fclose(fp);
}
+void check_fgetc(void) {
balazske wrote:
This should be `check_fputc`.
https://github.com/llvm/llvm-project/pull/71518
___
cfe-commits mailing list
cfe-
@@ -745,6 +751,46 @@ void StreamChecker::evalFreadFwrite(const FnDescription
*Desc,
C.addTransition(StateFailed);
}
+void StreamChecker::evalFgetcFputc(const FnDescription *Desc,
balazske wrote:
I do not know if there are enough similarities between `fpu
balazske wrote:
I tested on vim and the problematic report disappeared, no other changes were
detected.
https://github.com/llvm/llvm-project/pull/71373
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/list
balazske wrote:
The checker was already tested on some projects, but much more is needed to
find such corner cases. It can be better to manually check the functions for
cases when a 0 return value is not possible or only at a special (known) case.
https://github.com/llvm/llvm-project/pull/7137
https://github.com/balazske updated
https://github.com/llvm/llvm-project/pull/71392
From e92bf72fc80bb6823996cb71cb811d238b304aaa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?=
Date: Thu, 2 Nov 2023 18:12:32 +0100
Subject: [PATCH 1/3] [clang][analyzer] Improve 'errno' handli
https://github.com/balazske closed
https://github.com/llvm/llvm-project/pull/71373
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
balazske wrote:
The functional change looks good but the reformatting should be put into a
separate change.
https://github.com/llvm/llvm-project/pull/72016
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/
https://github.com/balazske created
https://github.com/llvm/llvm-project/pull/72242
Operators that are overloadable may be parsed as `CXXOperatorCallExpr` or as
`UnaryOperator` (or `BinaryOperator`). This depends on the context and can be
different if a similar construct is imported into an ex
@@ -268,3 +302,20 @@ void error_indeterminate_feof2(void) {
}
fclose(F);
}
+
+void error_indeterminate_feof3(void) {
+ FILE *F = fopen("file", "r+");
+ if (!F)
+return;
+ char Buf[10];
+ if (fread(Buf, 1, 10, F) < 10) {
+if (feof(F)) {
+ // error is feof, s
@@ -101,6 +101,23 @@ void error_fwrite(void) {
Ret = fwrite(0, 1, 10, F); // expected-warning {{Stream might be already
closed}}
}
+void error_fputc(void) {
+ FILE *F = tmpfile();
+ if (!F)
+return;
+ int Ret = fputc('X', F);
+ if (Ret == EOF) {
bal
https://github.com/balazske approved this pull request.
https://github.com/llvm/llvm-project/pull/74291
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1188,6 +1192,18 @@ void StreamChecker::evalSetFeofFerror(const
FnDescription *Desc,
C.addTransition(State);
}
+void StreamChecker::preFflush(const FnDescription *Desc, const CallEvent &Call,
+ CheckerContext &C) const {
+ // Skip if the str
@@ -299,6 +299,15 @@ void error_fseek_0(void) {
fclose(F);
}
+void error_fflush(void) {
+ FILE *F = tmpfile();
+ if (!F)
+return;
+ fclose(F);
+ fflush(F);// expected-warning {{Stream might be already closed}}
+ fflush(NULL); // no-warning
balaz
https://github.com/balazske edited
https://github.com/llvm/llvm-project/pull/74296
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -299,6 +299,15 @@ void error_fseek_0(void) {
fclose(F);
}
+void error_fflush(void) {
+ FILE *F = tmpfile();
+ if (!F)
+return;
+ fclose(F);
+ fflush(F);// expected-warning {{Stream might be already closed}}
+ fflush(NULL); // no-warning
+}
+
https://github.com/balazske requested changes to this pull request.
For now only the pre-condition is added, the `evalFflush` function is missing.
https://github.com/llvm/llvm-project/pull/74296
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
h
https://github.com/balazske updated
https://github.com/llvm/llvm-project/pull/72841
From 99d6169f62862b7b1147da7fd26a85df20a0aba5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?=
Date: Mon, 20 Nov 2023 10:14:52 +0100
Subject: [PATCH 1/3] [clang][ASTImporter] Fix import of vari
@@ -5050,6 +5050,59 @@ TEST_P(ImportFriendClasses, RecordVarTemplateDecl) {
EXPECT_EQ(ToTUX, ToX);
}
+TEST_P(ASTImporterOptionSpecificTestBase, VarTemplateDeclConflict) {
+ getToTuDecl(
+ R"(
+ template
+ constexpr int X = 1;
+ )",
+ Lang_CXX14);
+
@@ -1191,6 +1199,49 @@ void StreamChecker::evalSetFeofFerror(const
FnDescription *Desc,
C.addTransition(State);
}
+void StreamChecker::preFflush(const FnDescription *Desc, const CallEvent &Call,
+ CheckerContext &C) const {
+ ProgramStateRef St
@@ -1191,6 +1199,49 @@ void StreamChecker::evalSetFeofFerror(const
FnDescription *Desc,
C.addTransition(State);
}
+void StreamChecker::preFflush(const FnDescription *Desc, const CallEvent &Call,
+ CheckerContext &C) const {
+ ProgramStateRef St
@@ -299,6 +299,21 @@ void error_fseek_0(void) {
fclose(F);
}
+void error_fflush(void) {
+ FILE *F = tmpfile();
+ int Ret;
+ fflush(NULL); // no-warning
+ if (!F) {
+if ((Ret = fflush(F)) != EOF)// no-warning
+ clang_analyzer_eval(Ret ==
https://github.com/balazske created
https://github.com/llvm/llvm-project/pull/74627
A friend template that is in a dependent context is not linked into declaration
chains (for example with the definition of the befriended template). This
condition was not correctly handled by `ASTImporter`.
F
@@ -5943,10 +5954,13 @@ ExpectedDecl
ASTNodeImporter::VisitClassTemplateDecl(ClassTemplateDecl *D) {
// FIXME: sufficient conditon for 'IgnoreTemplateParmDepth'?
bool IgnoreTemplateParmDepth =
balazske wrote:
Change of this condition was need
https://github.com/balazske updated
https://github.com/llvm/llvm-project/pull/74627
From cbcb81ebdbc49e3bd11b6f716ac14658a729b787 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?=
Date: Tue, 5 Dec 2023 15:23:37 +0100
Subject: [PATCH 1/2] [clang][ASTImporter] Improve import of f
https://github.com/balazske approved this pull request.
The change is OK, automated tests show a failure but it is in an unrelated test.
https://github.com/llvm/llvm-project/pull/72016
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lis
https://github.com/balazske approved this pull request.
https://github.com/llvm/llvm-project/pull/72358
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/balazske approved this pull request.
https://github.com/llvm/llvm-project/pull/71518
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
balazske wrote:
> I also think that the
> [reports](https://codechecker-demo.eastus.cloudapp.azure.com/Default/report-detail?run=postgres_REL_13_0_errno_alpha_unix&newcheck=postgres_REL_13_0_errno_unix&is-unique=on&diff-type=New&report-id=3253666&report-hash=b4e0b723164236269fe6078ad32a0456&repo
https://github.com/balazske closed
https://github.com/llvm/llvm-project/pull/71392
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/balazske created
https://github.com/llvm/llvm-project/pull/72841
In some cases variable templates (specially if static member of record) were
not correctly imported and an assertion "Missing call to MapImported?" could
happen.
From 99d6169f62862b7b1147da7fd26a85df20a0aba5 M
https://github.com/balazske updated
https://github.com/llvm/llvm-project/pull/69469
From 0fdc57b49002afd8aa54043837ee4155688b4c36 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?=
Date: Tue, 17 Oct 2023 11:51:27 +0200
Subject: [PATCH] [clang][Analyzer] Move checker 'alpha.unix.
https://github.com/balazske updated
https://github.com/llvm/llvm-project/pull/69469
From 0fdc57b49002afd8aa54043837ee4155688b4c36 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?=
Date: Tue, 17 Oct 2023 11:51:27 +0200
Subject: [PATCH 1/2] [clang][Analyzer] Move checker 'alpha.u
https://github.com/balazske closed
https://github.com/llvm/llvm-project/pull/69469
___
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/72841
From 99d6169f62862b7b1147da7fd26a85df20a0aba5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?=
Date: Mon, 20 Nov 2023 10:14:52 +0100
Subject: [PATCH 1/2] [clang][ASTImporter] Fix import of vari
@@ -768,26 +772,56 @@ void StreamChecker::evalFputc(const FnDescription *Desc,
const CallEvent &Call,
assertStreamStateOpened(OldSS);
+ // `fgetc` returns the read character on success, otherwise returns EOF.
// `fputc` returns the written character on success, otherwi
https://github.com/balazske edited
https://github.com/llvm/llvm-project/pull/72627
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -101,6 +101,30 @@ void error_fwrite(void) {
Ret = fwrite(0, 1, 10, F); // expected-warning {{Stream might be already
closed}}
}
+void error_fgetc(void) {
+ FILE *F = tmpfile();
+ if (!F)
+return;
+ int Ret = fgetc(F);
+ if (0 <= Ret && Ret <= 255) {
+clang_an
@@ -259,14 +283,33 @@ void error_indeterminate_clearerr(void) {
fclose(F);
}
+void error_indeterminate_fgetc(void) {
+ FILE *F = fopen("file", "r+");
+ if (!F)
+return;
+ int rc = fseek(F, 0, SEEK_SET);
+ if (rc) {
+if (feof(F)) {
balazske wrote:
@@ -303,3 +346,29 @@ void error_indeterminate_feof2(void) {
}
fclose(F);
}
+
+void error_indeterminate_feof3(void) {
+ FILE *F = fopen("file", "r+");
+ if (!F)
+return;
+ if (fgetc(F) == EOF) {
+if (feof(F)) {
+ // error is feof, should be non-indeterminate
https://github.com/balazske requested changes to this pull request.
https://github.com/llvm/llvm-project/pull/72627
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -303,3 +346,29 @@ void error_indeterminate_feof2(void) {
}
fclose(F);
}
+
+void error_indeterminate_feof3(void) {
balazske wrote:
This test seems to be not necessary (previous tests cover these conditions),
otherwise a more meaningful name should be ch
@@ -259,14 +283,33 @@ void error_indeterminate_clearerr(void) {
fclose(F);
}
+void error_indeterminate_fgetc(void) {
+ FILE *F = fopen("file", "r+");
+ if (!F)
+return;
+ int rc = fseek(F, 0, SEEK_SET);
+ if (rc) {
+if (feof(F)) {
+ clang_analyzer_warnIfReac
@@ -101,6 +101,30 @@ void error_fwrite(void) {
Ret = fwrite(0, 1, 10, F); // expected-warning {{Stream might be already
closed}}
}
+void error_fgetc(void) {
+ FILE *F = tmpfile();
+ if (!F)
+return;
+ int Ret = fgetc(F);
+ if (0 <= Ret && Ret <= 255) {
+clang_an
@@ -768,26 +772,65 @@ void StreamChecker::evalFputc(const FnDescription *Desc,
const CallEvent &Call,
assertStreamStateOpened(OldSS);
+ // `fgetc` returns the read character on success, otherwise returns EOF.
// `fputc` returns the written character on success, otherwi
balazske wrote:
If I remember correctly there is somewhere in the clang documentation a file
that refers to this checker, and the purpose of this checker is mostly
documentation. I do not know if it is good to change the code or to extend this
checker, because there is `StreamChecker` that sho
https://github.com/balazske commented:
The change is good but the title is too general, for example "Update
CallDescription in StreamChecker for `tmpfile`", and this is not a NFC (it
fixes a problem).
https://github.com/llvm/llvm-project/pull/70540
_
https://github.com/balazske edited
https://github.com/llvm/llvm-project/pull/70540
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
balazske wrote:
I would like to have the new test in `stream.c` (not `stream.cpp`) because the
C++ test file contains only C++ related StreamChecker tests (`tmpfile` belongs
not here). And a "FIXME" could be added to the test to indicate that this is a
faulty behavior (in the current case). Th
https://github.com/balazske edited
https://github.com/llvm/llvm-project/pull/70540
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/balazske approved this pull request.
https://github.com/llvm/llvm-project/pull/70540
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,16 @@
+// RUN: %clang_analyze_cc1 -fno-builtin
-analyzer-checker=core,alpha.unix.Stream -verify %s
+// expected-no-diagnostics
+
+typedef struct _FILE FILE;
+
+// These functions are not standard C library functions.
+FILE *tmpfile(const char *restrict path); // Real '
https://github.com/balazske created
https://github.com/llvm/llvm-project/pull/71373
The functions 'readlink' and 'readlinkat' do return 0 only if the 'bufsize'
argument is 0.
From 653aeb7f5b0d0f200b3f706bad770a9be643669c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?=
Date:
@@ -9284,6 +9284,24 @@ TEST_P(ASTImporterOptionSpecificTestBase,
// EXPECT_EQ(ToF1Imported->getPreviousDecl(), ToF1);
}
+const internal::VariadicDynCastAllOfMatcher
+builtinBitCastExpr;
+
+TEST_P(ASTImporterOptionSpecificTestBase, ImportBuiltinBitCastExpr) {
+ const cha
balazske wrote:
The problem may be related to the fact that template parameter declarations can
have the `TranslationUnitDecl` as parent until the template (with these
parameters) is finally created. In the temporary phase the object
(`TemplateTypeParmDecl`) is found with lookup if it has the
balazske wrote:
The `VisitTypeAliasTemplateDecl` function should be re-designed to check for
structural equivalence at import. The following test does not pass because an
existing `TypeAliasTemplateDecl` declaration with the same name is always found
and returned, without check for structural
@@ -9284,6 +9284,26 @@ TEST_P(ASTImporterOptionSpecificTestBase,
// EXPECT_EQ(ToF1Imported->getPreviousDecl(), ToF1);
}
+TEST_P(ASTImporterOptionSpecificTestBase, ImportFunctionAutoType) {
balazske wrote:
This test belongs to `ImportAutoFunctions` and a bet
https://github.com/balazske created
https://github.com/llvm/llvm-project/pull/75308
Expression of attribute `align_value` was not imported. Import of the attribute
is corrected, a test for it is added, other related tests with FIXME are
updated.
Fixes #75054.
From 2e6fe315bdebea705d84b4152a83
balazske wrote:
`VisitTypeAliasTemplateDecl` looks wrong and some fix should be made, this PR
is good for the fix. This import function is different from the others because
`ConflictingDecls` is populated when an object with different type is found,
but this is the correct way. I think that `T
1 - 100 of 829 matches
Mail list logo