[all-commits] [llvm/llvm-project] 9081fa: [Analyzer][StreamChecker] Added check for "indeter...

Balázs Kéri via All-commits all-commits at lists.llvm.org
Wed May 27 23:21:10 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 9081fa20991d101728434b354a96283b26495b71
      https://github.com/llvm/llvm-project/commit/9081fa20991d101728434b354a96283b26495b71
  Author: Balázs Kéri <1.int32 at gmail.com>
  Date:   2020-05-28 (Thu, 28 May 2020)

  Changed paths:
    M clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
    M clang/test/Analysis/stream-error.c

  Log Message:
  -----------
  [Analyzer][StreamChecker] Added check for "indeterminate file position".

Summary:
According to the standard, after a `wread` or `fwrite` call the file position
becomes "indeterminate". It is assumable that a next read or write causes
undefined behavior, so a (fatal error) warning is added for this case.
The indeterminate position can be cleared by some operations, for example
`fseek` or `freopen`, not with `clearerr`.

Reviewers: Szelethus, baloghadamsoftware, martong, NoQ, xazax.hun, dcoughlin

Reviewed By: Szelethus

Subscribers: rnkovacs, NoQ, xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, gamesh411, Charusso, martong, ASDenysPetrov, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D80018




More information about the All-commits mailing list