[PATCH] D75851: [Analyzer][StreamChecker] Added evaluation of fseek.

2020-04-14 Thread Balázs Kéri via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGf2b5e60dfd09: [Analyzer][StreamChecker] Added evaluation of fseek. (authored by balazske). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75851/new/ https://

[PATCH] D75851: [Analyzer][StreamChecker] Added evaluation of fseek.

2020-04-09 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 256317. balazske added a comment. Addressed review comments (reformat and rename). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75851/new/ https://reviews.llvm.org/D75851 Files: clang/lib/StaticAnalyzer/Ch

[PATCH] D75851: [Analyzer][StreamChecker] Added evaluation of fseek.

2020-04-09 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! You seem to have a firm grasp on where you want this checker to go, and I like everything about it. The code needs seme `clang-format` treatment, and another eye might not hurt, b

[PATCH] D75851: [Analyzer][StreamChecker] Added evaluation of fseek.

2020-04-08 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 256023. balazske added a comment. - Rebase - Improved comments - Changed `UnknownError` to `Unknown` - Test changes (removed unneeded test) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75851/new/ https://revi

[PATCH] D75851: [Analyzer][StreamChecker] Added evaluation of fseek.

2020-04-08 Thread Balázs Kéri via Phabricator via cfe-commits
balazske marked an inline comment as done. balazske added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:103-110 + /// Return if the specified error kind is possible on the stream in the + /// current state. + /// This depends on the stored `L

[PATCH] D75851: [Analyzer][StreamChecker] Added evaluation of fseek.

2020-04-08 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus marked an inline comment as done. Szelethus added a comment. In D75851#1933538 , @balazske wrote: > Simplified code. I can tell! The patch is amazing, the code practically reads itself aloud. I have some inlines but nothing major, the high lev

[PATCH] D75851: [Analyzer][StreamChecker] Added evaluation of fseek.

2020-03-20 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 251640. balazske added a comment. Simplified code. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75851/new/ https://reviews.llvm.org/D75851 Files: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp clang

[PATCH] D75851: [Analyzer][StreamChecker] Added evaluation of fseek.

2020-03-18 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 251112. balazske added a comment. Herald added a subscriber: ASDenysPetrov. Rebased. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75851/new/ https://reviews.llvm.org/D75851 Files: clang/lib/StaticAnalyzer/

[PATCH] D75851: [Analyzer][StreamChecker] Added evaluation of fseek.

2020-03-17 Thread Balázs Kéri via Phabricator via cfe-commits
balazske marked an inline comment as done. balazske added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:470 - // Make the return value accordingly to the error. - State = State->assume(RetVal, (SS->*IsOfError)()); - assert(State && "Return

[PATCH] D75851: [Analyzer][StreamChecker] Added evaluation of fseek.

2020-03-15 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:470 - // Make the return value accordingly to the error. - State = State->assume(RetVal, (SS->*IsOfError)()); - assert(State && "Return value should not be constrained already."); - C

[PATCH] D75851: [Analyzer][StreamChecker] Added evaluation of fseek.

2020-03-12 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 249904. balazske added a comment. Rebased, added handling of UnknownError. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75851/new/ https://reviews.llvm.org/D75851 Files: clang/lib/StaticAnalyzer/Checkers/S

[PATCH] D75851: [Analyzer][StreamChecker] Added evaluation of fseek.

2020-03-11 Thread Balázs Kéri via Phabricator via cfe-commits
balazske marked an inline comment as done. balazske added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:382-384 + C.addTransition(StateNotFailed); + C.addTransition(StateFailedWithFError); + C.addTransition(StateFailedWithoutFError);

[PATCH] D75851: [Analyzer][StreamChecker] Added evaluation of fseek.

2020-03-11 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:382-384 + C.addTransition(StateNotFailed); + C.addTransition(StateFailedWithFError); + C.addTransition(StateFailedWithoutFError); Szelethus wrote: > balaz

[PATCH] D75851: [Analyzer][StreamChecker] Added evaluation of fseek.

2020-03-11 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. Probably we need to clarify when to make warnings. Originally I do not wanted a warning after for example failed read, because it is possible to retry the operation. But the standard says that after failed fread the file position is indeterminate, so a new read may get

[PATCH] D75851: [Analyzer][StreamChecker] Added evaluation of fseek.

2020-03-10 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. In D75851#1915014 , @Szelethus wrote: > In D75851#1914874 , @balazske wrote: > > > After a failed file operation we do not know if it was feof or ferror kind > > of error. > > > Is this t

[PATCH] D75851: [Analyzer][StreamChecker] Added evaluation of fseek.

2020-03-10 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. In D75851#1914874 , @balazske wrote: > I do not like to make difference between error from `fseek` and error from > any other function that may fail. `AnyError` can be used to handle every case. Okay, it took me a while, but I

[PATCH] D75851: [Analyzer][StreamChecker] Added evaluation of fseek.

2020-03-10 Thread Balázs Kéri via Phabricator via cfe-commits
balazske marked an inline comment as done. balazske added a comment. I do not like to make difference between error from `fseek` and error from any other function that may fail. `AnyError` can be used to handle every case. After a failed file operation we do not know if it was `feof` or `ferror`

[PATCH] D75851: [Analyzer][StreamChecker] Added evaluation of fseek.

2020-03-10 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus requested changes to this revision. Szelethus added a comment. This revision now requires changes to proceed. We should totally dedicate an error kind of `fseek`, see (and please respond, if you could to) D75356#inline-689287 .

[PATCH] D75851: [Analyzer][StreamChecker] Added evaluation of fseek.

2020-03-09 Thread Balázs Kéri via Phabricator via cfe-commits
balazske created this revision. Herald added subscribers: cfe-commits, martong, Charusso, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: Szelethus. Herald added a project: clang. balazske added a parent revisio