[all-commits] [llvm/llvm-project] ce1a86: [Analyzer][StreamChecker] Check for opened stream ...

Balázs Kéri via All-commits all-commits at lists.llvm.org
Mon Mar 9 03:05:50 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: ce1a86251bb42fbbc7cc21feb416ed7a0bf411b7
      https://github.com/llvm/llvm-project/commit/ce1a86251bb42fbbc7cc21feb416ed7a0bf411b7
  Author: Balázs Kéri <1.int32 at gmail.com>
  Date:   2020-03-09 (Mon, 09 Mar 2020)

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

  Log Message:
  -----------
  [Analyzer][StreamChecker] Check for opened stream before operations.

Summary:
According to documentations, after an `fclose` call any other stream
operations cause undefined behaviour, regardless if the close failed
or not.
This change adds the check for the opened state before all other
(applicable) operations.

Reviewers: Szelethus

Reviewed By: Szelethus

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

Tags: #clang

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




More information about the All-commits mailing list