]> granicus.if.org Git - clang/commit
[analyzer] PthreadLockChecker: model failed pthread_mutex_destroy() calls.
authorArtem Dergachev <artem.dergachev@gmail.com>
Mon, 29 May 2017 14:51:39 +0000 (14:51 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Mon, 29 May 2017 14:51:39 +0000 (14:51 +0000)
commit1e698dbb9d9d9334f426b44dde2e35abc1807061
treeed3f2d799a5b4f31085cef2dcc5aa9395a8e5ded
parentec038a4a53332cd1b2d9dc1379d6e654a107399a
[analyzer] PthreadLockChecker: model failed pthread_mutex_destroy() calls.

pthread_mutex_destroy() may fail, returning a non-zero error number, and
keeping the mutex untouched. The mutex can be used on the execution branch
that follows such failure, so the analyzer shouldn't warn on using
a mutex that was previously destroyed, when in fact the destroy call has failed.

Patch by Malhar Thakkar!

Differential revision: https://reviews.llvm.org/D32449

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304159 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp
test/Analysis/pthreadlock.c