https://github.com/benshi001 closed
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
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
https://github.com/benshi001 updated
https://github.com/llvm/llvm-project/pull/71518
>From 15367bae9f129b20885f13e5ca5ae816271d7214 Mon Sep 17 00:00:00 2001
From: Ben Shi
Date: Tue, 7 Nov 2023 16:44:05 +0800
Subject: [PATCH] [clang][analyzer] Support `fputc` in StreamChecker
---
.../StaticAna
@@ -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
@@ -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
https://github.com/benshi001 updated
https://github.com/llvm/llvm-project/pull/71518
>From 2ebbb60c04968f9c953790daa5c791f072d975b8 Mon Sep 17 00:00:00 2001
From: Ben Shi
Date: Tue, 7 Nov 2023 16:44:05 +0800
Subject: [PATCH] [clang][analyzer] Support `fputc` in StreamChecker
---
.../StaticAna
https://github.com/benshi001 updated
https://github.com/llvm/llvm-project/pull/71518
>From 7918014a23d4e4e996896164139dafe3c98aa8a5 Mon Sep 17 00:00:00 2001
From: Ben Shi
Date: Tue, 7 Nov 2023 16:44:05 +0800
Subject: [PATCH] [clang][analyzer] Support `fputc` in StreamChecker
---
.../StaticAna
@@ -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
@@ -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-
@@ -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
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
@@ -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 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
https://github.com/benshi001 updated
https://github.com/llvm/llvm-project/pull/71518
>From b12b8ef5b9cc65cabf14eeeb3dacd6f41e5bf54e Mon Sep 17 00:00:00 2001
From: Ben Shi
Date: Tue, 7 Nov 2023 16:44:05 +0800
Subject: [PATCH] [clang][analyzer] Support `fputc` in StreamChecker
---
.../StaticAna
https://github.com/benshi001 updated
https://github.com/llvm/llvm-project/pull/71518
>From 3a51a9067e2581e1cb7091e24725439a991fdc78 Mon Sep 17 00:00:00 2001
From: Ben Shi
Date: Tue, 7 Nov 2023 16:44:05 +0800
Subject: [PATCH] [clang][analyzer] Support `fputc` in StreamChecker
---
.../StaticAna
https://github.com/benshi001 updated
https://github.com/llvm/llvm-project/pull/71518
>From eb4da0df114586c4099a495e5114ab0c1c9f9e27 Mon Sep 17 00:00:00 2001
From: Ben Shi
Date: Tue, 7 Nov 2023 16:44:05 +0800
Subject: [PATCH] [clang][analyzer] Support `fputc` in StreamChecker
---
.../StaticAna
https://github.com/benshi001 reopened
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
https://github.com/michaelmaitland closed
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
benshi001 wrote:
`fgetc` should also be supported, and I will do that next week.
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
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: Ben Shi (benshi001)
Changes
---
Full diff: https://github.com/llvm/llvm-project/pull/71518.diff
3 Files Affected:
- (modified) clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp (+66-8)
- (modified) clang/test/Analysis/stream-error.c
https://github.com/benshi001 created
https://github.com/llvm/llvm-project/pull/71518
None
>From c2411fe31a465eaafc8606b5f0ef95d94781a25b Mon Sep 17 00:00:00 2001
From: Ben Shi
Date: Tue, 7 Nov 2023 16:44:05 +0800
Subject: [PATCH] [clang][analyzer] Support `fputc` in StreamChecker
---
.../Sta
21 matches
Mail list logo