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 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:
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 updated
https://github.com/llvm/llvm-project/pull/69724
From 2bfad6f0fbb7a5757318c77ef76335986d23ab83 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?=
Date: Thu, 19 Oct 2023 16:27:24 +0200
Subject: [PATCH 1/2] [clang][ASTImporter] Fix import of
Sub
https://github.com/balazske edited
https://github.com/llvm/llvm-project/pull/68774
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1373,6 +1373,40 @@ TEST_P(ASTImporterOptionSpecificTestBase,
ImportCorrectTemplatedDecl) {
ASSERT_EQ(ToTemplated1, ToTemplated);
}
+TEST_P(ASTImporterOptionSpecificTestBase,
+ ImportTemplateSpecializationStaticMember) {
+ auto FromCode = R"(
+ template clas
https://github.com/balazske commented:
The fix looks good but the formatting of the test code could be better, like in
the other tests.
https://github.com/llvm/llvm-project/pull/68774
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lis
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 '
@@ -2519,12 +2519,17 @@ void StdLibraryFunctionsChecker::initFunctionSummaries(
addToFunctionSummaryMap(
"getcwd", Signature(ArgTypes{CharPtrTy, SizeTy}, RetType{CharPtrTy}),
Summary(NoEvalCall)
-.Case({ReturnValueCondition(BO_EQ, ArgNo(0))},
+
@@ -2519,12 +2519,17 @@ void StdLibraryFunctionsChecker::initFunctionSummaries(
addToFunctionSummaryMap(
"getcwd", Signature(ArgTypes{CharPtrTy, SizeTy}, RetType{CharPtrTy}),
Summary(NoEvalCall)
-.Case({ReturnValueCondition(BO_EQ, ArgNo(0))},
+
@@ -75,13 +75,16 @@ void errno_mkdtemp(char *template) {
}
}
-void errno_getcwd(char *Buf, size_t sz) {
- char *Path = getcwd(Buf, sz);
- if (Path == NULL) {
-clang_analyzer_eval(errno != 0); // expected-warning{{TRUE}}
-if (errno) {} /
https://github.com/balazske updated
https://github.com/llvm/llvm-project/pull/76979
From e24b90eebfff7a352dd2c0df7f948ffef26ea3b3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?=
Date: Thu, 4 Jan 2024 18:16:12 +0100
Subject: [PATCH 1/3] [clang][analyzer] Add missing stream rel
https://github.com/balazske approved this pull request.
This reordering is not a significant feature (and may change in the future) and
no test existed before, it is enough (if this exists) if there is a GDB test
for the crash.
https://github.com/llvm/llvm-project/pull/77079
__
https://github.com/balazske approved this pull request.
https://github.com/llvm/llvm-project/pull/77040
___
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/77331
`StdLibraryFunctionsChecker` is updated too with `ungetc`.
From 9bcc43b5c62ba969f91c495d4d570c5c4337aca2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?=
Date: Mon, 8 Jan 2024 16:42:58 +0100
S
https://github.com/balazske updated
https://github.com/llvm/llvm-project/pull/77331
From 9bcc43b5c62ba969f91c495d4d570c5c4337aca2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?=
Date: Mon, 8 Jan 2024 16:42:58 +0100
Subject: [PATCH 1/2] [clang][analyzer] Add 'ungetc' to Stream
https://github.com/balazske updated
https://github.com/llvm/llvm-project/pull/77331
From 9bcc43b5c62ba969f91c495d4d570c5c4337aca2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?=
Date: Mon, 8 Jan 2024 16:42:58 +0100
Subject: [PATCH 1/3] [clang][analyzer] Add 'ungetc' to Stream
@@ -916,6 +922,44 @@ void StreamChecker::evalFputx(const FnDescription *Desc,
const CallEvent &Call,
C.addTransition(StateFailed);
}
+void StreamChecker::evalUngetc(const FnDescription *Desc, const CallEvent
&Call,
+ CheckerContext &C) const {
@@ -916,6 +922,44 @@ void StreamChecker::evalFputx(const FnDescription *Desc,
const CallEvent &Call,
C.addTransition(StateFailed);
}
+void StreamChecker::evalUngetc(const FnDescription *Desc, const CallEvent
&Call,
+ CheckerContext &C) const {
balazske wrote:
I have already a patch to add these functions: #76979. The conditions for
`fputc` are not the same, this can be clarified at the other patch.
https://github.com/llvm/llvm-project/pull/77435
___
cfe-commits mailing list
cfe-commits@list
@@ -2201,6 +2214,56 @@ void StdLibraryFunctionsChecker::initFunctionSummaries(
ErrnoNEZeroIrrelevant, GenericFailureMsg)
.ArgConstraint(NotNull(ArgNo(0;
+// int fgetc(FILE *stream);
+// 'getc' is the same as 'fgetc' but may be a macro
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/4] [clang][ASTImporter] Improve import of f
@@ -5919,15 +5919,26 @@ ExpectedDecl
ASTNodeImporter::VisitClassTemplateDecl(ClassTemplateDecl *D) {
if (ToD)
return ToD;
- bool IsFriendTemplate = D->getFriendObjectKind() != Decl::FOK_None;
- bool IsDependentContext = DC != LexicalDC ? LexicalDC->isDependentContext(
https://github.com/balazske closed
https://github.com/llvm/llvm-project/pull/77331
___
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/77576
___
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/77613
[clang][analyzer] Add function 'fprintf' to StreamChecker.
From 574816e425d623b3b07674422b901879cc3c83c2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?=
Date: Wed, 10 Jan 2024 10:55:27 +0100
balazske wrote:
It is better to replace in code of `evalFtell` the `C.getASTContext().LongTy`
with `Call.getResultType()` (occurs 2 times), this is more exact if `off_t` is
defined to something else than `long`.
https://github.com/llvm/llvm-project/pull/77580
__
@@ -324,6 +355,57 @@ void error_fseek_0(void) {
fclose(F);
}
+void error_fseeko_0(void) {
+ FILE *F = fopen("file", "r");
+ if (!F)
+return;
+ int rc = fseeko(F, 0, SEEK_SET);
+ if (rc) {
+int IsFEof = feof(F), IsFError = ferror(F);
+// Get ferror or no error
@@ -324,6 +355,57 @@ void error_fseek_0(void) {
fclose(F);
}
+void error_fseeko_0(void) {
+ FILE *F = fopen("file", "r");
+ if (!F)
+return;
+ int rc = fseeko(F, 0, SEEK_SET);
+ if (rc) {
+int IsFEof = feof(F), IsFError = ferror(F);
+// Get ferror or no error
https://github.com/balazske deleted
https://github.com/llvm/llvm-project/pull/77580
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -324,6 +355,57 @@ void error_fseek_0(void) {
fclose(F);
}
+void error_fseeko_0(void) {
+ FILE *F = fopen("file", "r");
+ if (!F)
+return;
+ int rc = fseeko(F, 0, SEEK_SET);
+ if (rc) {
+int IsFEof = feof(F), IsFError = ferror(F);
+// Get ferror or no error
@@ -324,6 +355,57 @@ void error_fseek_0(void) {
fclose(F);
}
+void error_fseeko_0(void) {
+ FILE *F = fopen("file", "r");
+ if (!F)
+return;
+ int rc = fseeko(F, 0, SEEK_SET);
+ if (rc) {
+int IsFEof = feof(F), IsFError = ferror(F);
+// Get ferror or no error
@@ -268,8 +268,12 @@ class StreamChecker : public Checkerhttps://github.com/llvm/llvm-project/pull/77580
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -324,6 +343,60 @@ void error_fseek_0(void) {
fclose(F);
}
+void error_fseeko_0(void) {
+ FILE *F = fopen("file", "r");
+ if (!F)
+return;
+ int rc = fseeko(F, 0, SEEK_SET);
+ if (rc) {
+int IsFEof = feof(F), IsFError = ferror(F);
+// Get ferror or no error
@@ -268,8 +268,12 @@ class StreamChecker : public Checkerhttps://github.com/llvm/llvm-project/pull/77580
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/balazske closed
https://github.com/llvm/llvm-project/pull/74627
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/balazske deleted
https://github.com/llvm/llvm-project/pull/77580
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/balazske deleted
https://github.com/llvm/llvm-project/pull/77580
___
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/77580
___
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/77613
From 96a786f07ca5fb84b372e0b7c60f371bf4cdfd7c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?=
Date: Wed, 10 Jan 2024 10:55:27 +0100
Subject: [PATCH] [clang][analyzer] Add function 'fprintf' to
@@ -2859,13 +2859,19 @@ void StdLibraryFunctionsChecker::initFunctionSummaries(
"fseeko",
Signature(ArgTypes{FilePtrTy, Off_tTy, IntTy}, RetType{IntTy}),
Summary(NoEvalCall)
-.Case(ReturnsZeroOrMinusOne, ErrnoIrrelevant)
-.ArgCons
@@ -2859,13 +2859,19 @@ void StdLibraryFunctionsChecker::initFunctionSummaries(
"fseeko",
Signature(ArgTypes{FilePtrTy, Off_tTy, IntTy}, RetType{IntTy}),
Summary(NoEvalCall)
-.Case(ReturnsZeroOrMinusOne, ErrnoIrrelevant)
-.ArgCons
https://github.com/balazske closed
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
https://github.com/balazske updated
https://github.com/llvm/llvm-project/pull/72242
From 5300f979c96eb2f88c298872f0519e274c155cfe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?=
Date: Tue, 14 Nov 2023 11:53:20 +0100
Subject: [PATCH 1/3] [clang][ASTImporter] Improve structural
@@ -2252,6 +2252,176 @@ TEST_F(StructuralEquivalenceStmtTest,
UnaryOperatorDifferentOps) {
EXPECT_FALSE(testStructuralMatch(t));
}
+TEST_F(StructuralEquivalenceStmtTest,
+ CXXOperatorCallExprVsUnaryBinaryOperator) {
+ auto t = makeNamedDecls(
+ R"(
+ templa
@@ -6245,17 +6245,21 @@ ExpectedDecl
ASTNodeImporter::VisitVarTemplateDecl(VarTemplateDecl *D) {
D->getTemplatedDecl()))
continue;
if (IsStructuralMatch(D, FoundTemplate)) {
-// The Decl in the "From" context
https://github.com/balazske closed
https://github.com/llvm/llvm-project/pull/67680
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/balazske closed
https://github.com/llvm/llvm-project/pull/66207
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/balazske reopened
https://github.com/llvm/llvm-project/pull/66207
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/balazske closed
https://github.com/llvm/llvm-project/pull/66207
___
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/69469
None
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
balazske wrote:
This checker was dependent on `unix.StdCLibraryFunctions`. After that checker
was moved out of alpha, it is possible to move `alpha.unix.Errno` out of alpha.
The checker was tested first on the following projects. The following links
were automatically generated to compare the c
balazske wrote:
The checker was tested additionally on projects libwebm, bitcoin, contour and
produced no results.
https://github.com/llvm/llvm-project/pull/69469
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/m
https://github.com/balazske created
https://github.com/llvm/llvm-project/pull/69724
Import of a function with `auto` return type that is expanded to a
`SubstTemplateTypeParmType` could fail if the function itself is the template
specialization where the parameter was replaced.
From 2bfad6f0fb
@@ -934,6 +934,76 @@ Check calls to various UNIX/Posix functions: ``open,
pthread_once, calloc, mallo
.. literalinclude:: checkers/unix_api_example.c
:language: c
+.. _unix-Errno:
+
+unix.Errno (C)
+""
+
+Check for improper use of ``errno``.
+This checker impl
https://github.com/balazske edited
https://github.com/llvm/llvm-project/pull/70170
___
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.
Probably add [clang] tag to the commit message, and remove the change in
DiagnosticParseKinds.td, otherwise the change looks good.
https://github.com/llvm/llvm-project/pull/70170
___
@@ -1349,7 +1349,7 @@ def warn_omp_extra_tokens_at_eol : Warning<
"extra tokens at the end of '#pragma omp %0' are ignored">,
InGroup;
def err_omp_multiple_step_or_linear_modifier : Error<
- "multiple %select{'step size'|'linear modifier'}0 found in linear clause">;
+ "m
https://github.com/balazske approved this pull request.
https://github.com/llvm/llvm-project/pull/70170
___
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:
You have found that reason for the crash is that references to `IdentifierInfo`
are remaining in `OnDiskChainedHashTableGenerator` and previously deallocated
by `ASTUnit` destruction? In this case why is the `ASTUnit` (or something in
it, probably `ASTContext`) the owner of the
balazske wrote:
I plan to fix import of `VarTemplateSpecializationDecl` in a different PR. The
indicated assertion "Missing call to MapImported?" is likely to related to this
part.
https://github.com/llvm/llvm-project/pull/72841
___
cfe-commits maili
101 - 200 of 709 matches
Mail list logo