[PATCH] D75614: [Analyzer][StreamChecker] Check for opened stream before operations.
Balázs Kéri via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 4 08:25:05 PST 2020
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.
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.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D75614
Files:
clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
clang/test/Analysis/stream.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75614.248181.patch
Type: text/x-patch
Size: 9784 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200304/2bdcf6df/attachment-0001.bin>
More information about the cfe-commits
mailing list