[PATCH] D104925: [Analyzer] Improve report of file read at end-of-file condition.

2021-07-20 Thread Balázs Kéri via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG90cb5297adf0: [clang][analyzer] Improve report of file read at EOF condition (alpha.unix. (authored by balazske). Repository: rG LLVM Github Monor

[PATCH] D104925: [Analyzer] Improve report of file read at end-of-file condition.

2021-07-19 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus accepted this revision. Szelethus added a comment. This revision is now accepted and ready to land. LGTM! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104925/new/ https://reviews.llvm.org/D104925

[PATCH] D104925: [Analyzer] Improve report of file read at end-of-file condition.

2021-07-19 Thread Balázs Kéri via Phabricator via cfe-commits
balazske marked 3 inline comments as done. balazske added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:34-35 +const char *Desc_StreamEof = "Stream already in EOF"; +const char *Desc_ResourceLeak = "Resource leak"; + Szelethus

[PATCH] D104925: [Analyzer] Improve report of file read at end-of-file condition.

2021-07-19 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 359694. balazske added a comment. Removed `Instance`, small rename, fix of warning text. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104925/new/ https://reviews.llvm.org/D104925 Files: clang/lib/StaticAna

[PATCH] D104925: [Analyzer] Improve report of file read at end-of-file condition.

2021-07-16 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. Looks great now! Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:416 + + return "Assuming that stream reaches end-of-file here"; +}); The word "that" looks redundant, we don't use it in any other similar notes, eg.

[PATCH] D104925: [Analyzer] Improve report of file read at end-of-file condition.

2021-07-16 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. The bug reports speak for themselves, they are awesome. Nice work! Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:28-30 +//===--===// +// Definition of state data str

[PATCH] D104925: [Analyzer] Improve report of file read at end-of-file condition.

2021-07-15 Thread Balázs Kéri via Phabricator via cfe-commits
balazske marked 4 inline comments as done. balazske added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:419-421 + const CheckerNameRef CheckerName; + SymbolRef StreamSym; + const ExplodedNode *NotePosition; balazske wrote: >

[PATCH] D104925: [Analyzer] Improve report of file read at end-of-file condition.

2021-07-12 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 357947. balazske added a comment. Using the new symbol "uninterestingness" feature. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104925/new/ https://reviews.llvm.org/D104925 Files: clang/lib/StaticAnalyzer

[PATCH] D104925: [Analyzer] Improve report of file read at end-of-file condition.

2021-07-02 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:429-435 +const ExplodedNode *N = BR.getErrorNode(); +while (N && N != NotePosition) { + const StreamState *StreamS = N->getState()->get(StreamSym); + if (!StreamS || !

[PATCH] D104925: [Analyzer] Improve report of file read at end-of-file condition.

2021-07-01 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:419-421 + const CheckerNameRef CheckerName; + SymbolRef StreamSym; + const ExplodedNode *NotePosition; NoQ wrote: > I guess it's a matter of preference but I really

[PATCH] D104925: [Analyzer] Improve report of file read at end-of-file condition.

2021-07-01 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. Let's simplify this even further! Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:419-421 + const CheckerNameRef CheckerName; + SymbolRef StreamSym; + const ExplodedNode *NotePosition; I guess it's a matter of preference

[PATCH] D104925: [Analyzer] Improve report of file read at end-of-file condition.

2021-06-30 Thread Balázs Kéri via Phabricator via cfe-commits
balazske marked an inline comment as done. balazske added a comment. Updated to use `NoteTag`. Note "End-of-file status is discovered here" is removed. Comment at: clang/test/Analysis/stream-note.c:141 + int RRet = fread(Buf, 1, 1, F); // expected-note {{Assuming that stream

[PATCH] D104925: [Analyzer] Improve report of file read at end-of-file condition.

2021-06-30 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 355594. balazske added a comment. Using NoteTag. Removed the EOF sequence number. Renamed test functions. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104925/new/ https://reviews.llvm.org/D104925 Files: cl

[PATCH] D104925: [Analyzer] Improve report of file read at end-of-file condition.

2021-06-30 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. +1 for note tags. Comment at: clang/test/Analysis/stream-note.c:134 + +void check_eof_notes_3() { + FILE *F; Perhaps we could have some more explanatory test case names. I mean how _3 is different than _2? What is the case each of the

[PATCH] D104925: [Analyzer] Improve report of file read at end-of-file condition.

2021-06-29 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. In D104925#2846283 , @balazske wrote: > I could not find a way to pass the needed information from the BugReport to > the `NoteTag`. The "sequence number" (in `EofSeqMap`) is only known when the > bug is detected, this should be pas

[PATCH] D104925: [Analyzer] Improve report of file read at end-of-file condition.

2021-06-29 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. Is it better to save the actual `ExplodedNode` in the note tag? Then the error node of the `BugReport` can be used to search the bug path and check if the saved node is encountered. In this way a `NoteTag` could be used and the "sequence numbers" would be unnecessary.

[PATCH] D104925: [Analyzer] Improve report of file read at end-of-file condition.

2021-06-28 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. I could not find a way to pass the needed information from the BugReport to the `NoteTag`. The "sequence number" (in `EofSeqMap`) is only known when the bug is detected, this should be passed to the `NoteTag` somehow. The value is used to make the new note appear only

[PATCH] D104925: [Analyzer] Improve report of file read at end-of-file condition.

2021-06-28 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. Thanks! Why isn't this a `NoteTag`? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104925/new/ https://reviews.llvm.org/D104925 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D104925: [Analyzer] Improve report of file read at end-of-file condition.

2021-06-27 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 354791. balazske added a comment. Add checker name to commit message. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104925/new/ https://reviews.llvm.org/D104925 Files: clang/lib/StaticAnalyzer/Checkers/Stre

[PATCH] D104925: [Analyzer] Improve report of file read at end-of-file condition.

2021-06-25 Thread Balázs Kéri via Phabricator via cfe-commits
balazske created this revision. Herald added subscribers: manas, steakhal, ASDenysPetrov, martong, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun, whisperity. Herald added a reviewer: Szelethus. balazske requested review of this revisio