aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2021-12-21 10:30:01 +0100
committerDmitry Vyukov <dvyukov@google.com>2021-12-21 13:35:34 +0100
commitd4d86fede8084f84ec6d4716378d977ffff3cf1d (patch)
tree67fc8cb220b3862206dbd65374ff3584643f0915 /clang/lib/CodeGen/CodeGenFunction.cpp
parent17006033f9c763b80b1f59cb015cdbe934268b70 (diff)
downloadllvm-d4d86fede8084f84ec6d4716378d977ffff3cf1d.zip
llvm-d4d86fede8084f84ec6d4716378d977ffff3cf1d.tar.gz
llvm-d4d86fede8084f84ec6d4716378d977ffff3cf1d.tar.bz2
tsan: always handle closing of file descriptors
If we miss both close of a file descriptor and a subsequent open if the same file descriptor number, we report false positives between operations on the old and on the new descriptors. There are lots of ways to create new file descriptors, but for closing there is mostly close call. So we try to handle at least it. However, if the close happens in an ignored library, we miss it and start reporting false positives. Handle closing of file descriptors always, even in ignored libraries (as we do for malloc/free and other critical functions). But don't imitate memory accesses on close for ignored libraries. FdClose checks validity of the fd (fd >= 0) itself, so remove the excessive checks in the callers. Reviewed By: melver Differential Revision: https://reviews.llvm.org/D116095
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
0 files changed, 0 insertions, 0 deletions