NoQ added inline comments.
Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:201
+std::tie(StateRetNotNull, StateRetNull) =
+CM.assumeDual(StateStreamNull, RetVal);
+if (StateRetNull) {
baloghadamsoftware wrote:
> balazske wrote:
> >
This revision was automatically updated to reflect the committed changes.
Closed by commit rG7eafde981c69: [Checkers] Added support for freopen to
StreamChecker. (authored by balazske).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D69948/new/
https:
baloghadamsoftware accepted this revision.
baloghadamsoftware added a comment.
LGTM.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D69948/new/
https://reviews.llvm.org/D69948
___
cfe-commits mailing lis
martong accepted this revision.
martong added a comment.
This revision is now accepted and ready to land.
LGTM, but wait for others please.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D69948/new/
https://reviews.llvm.org/D69948
balazske added inline comments.
Comment at: clang/test/Analysis/stream.c:160
+} else {
+ // Open failed, f1 points now to an invalid stream but this condition is
currently not checked.
+ rewind(f1);
martong wrote:
> This comment is confusing for me
balazske updated this revision to Diff 231905.
balazske marked an inline comment as done.
balazske added a comment.
- rearrangement in evelFreopen, updated comment in test
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D69948/new/
https://reviews.llv
martong added inline comments.
Comment at: clang/test/Analysis/stream.c:160
+} else {
+ // Open failed, f1 points now to an invalid stream but this condition is
currently not checked.
+ rewind(f1);
This comment is confusing for me. Maybe there are
baloghadamsoftware added inline comments.
Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:201
+std::tie(StateRetNotNull, StateRetNull) =
+CM.assumeDual(StateStreamNull, RetVal);
+if (StateRetNull) {
balazske wrote:
> NoQ wrote:
> >
balazske marked an inline comment as done.
balazske added inline comments.
Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:201
+std::tie(StateRetNotNull, StateRetNull) =
+CM.assumeDual(StateStreamNull, RetVal);
+if (StateRetNull) {
NoQ added inline comments.
Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:201
+std::tie(StateRetNotNull, StateRetNull) =
+CM.assumeDual(StateStreamNull, RetVal);
+if (StateRetNull) {
Mmm, wait, this doesn't look right to me. You c
balazske marked 3 inline comments as done.
balazske added inline comments.
Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:189-190
+ // Check if error was generated.
+ if (C.isDifferent())
+return;
+
baloghadamsoftware wrote:
> balazske wrot
balazske updated this revision to Diff 230076.
balazske marked an inline comment as done.
balazske added a comment.
- Moved freopen after fopen, removed 'SValBuilder'.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D69948/new/
https://reviews.llvm.or
baloghadamsoftware added inline comments.
Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:176
+ const LocationContext *LCtx = C.getPredecessor()->getLocationContext();
+ ConstraintManager &CM = C.getConstraintManager();
+ auto *CE = dyn_cast_or_null(Call.getOri
balazske marked 5 inline comments as done.
balazske added inline comments.
Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:189-190
+ // Check if error was generated.
+ if (C.isDifferent())
+return;
+
NoQ wrote:
> That's actually one more goo
balazske updated this revision to Diff 229268.
balazske added a comment.
- Simplified the code.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D69948/new/
https://reviews.llvm.org/D69948
Files:
clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
NoQ added inline comments.
Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:176
+ const LocationContext *LCtx = C.getPredecessor()->getLocationContext();
+ ConstraintManager &CM = C.getConstraintManager();
+ auto *CE = dyn_cast_or_null(Call.getOriginExpr());
---
balazske marked 2 inline comments as done.
balazske added a comment.
I am still not sure in the `auto` type, I did not see that way of `auto` usage
often in clang code.
Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:176
+ const LocationContext *LCtx = C.getPr
balazske updated this revision to Diff 228424.
balazske marked an inline comment as done.
balazske added a comment.
- Do not allow null stream to freopen.
- Added comments.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D69948/new/
https://reviews.ll
balazske added a comment.
From the description `The original stream (if it exists) is closed.` I think it
is possible that the original stream does "not exist". But a test program
crashed with NULL argument (but not with a closed file). So null argument is
not permitted or at least does not wor
baloghadamsoftware added a comment.
Thank you for working on this. Please add comments to the code and maybe also
to the tests. I could not find anything in the standards about `freopen()` with
null-pointer for the stream parameter.
Comment at: clang/lib/StaticAnalyzer/Checke
balazske created this revision.
Herald added subscribers: cfe-commits, gamesh411, Szelethus, dkrupp.
Herald added a project: clang.
Extend StreamChecker with a new evaluation function for API call 'freopen'.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D69948
Files:
clang/l
21 matches
Mail list logo