]> granicus.if.org Git - clang/commit
Thread safety analysis: Fix crash for function pointers
authorAaron Puchert <aaronpuchert@alice-dsl.net>
Wed, 19 Sep 2018 00:19:38 +0000 (00:19 +0000)
committerAaron Puchert <aaronpuchert@alice-dsl.net>
Wed, 19 Sep 2018 00:19:38 +0000 (00:19 +0000)
commit4a9b0e9a580ad0b54a646d6fb04eb9b80d7c1a92
treefba17052fe4f141a928aec5f701a43b1c52df498
parent30d3f201efd974e92af39ab7522ca30ddb2a379a
Thread safety analysis: Fix crash for function pointers

For function pointers, the FunctionDecl of the callee is unknown, so
getDirectCallee will return nullptr. We have to catch that case to avoid
crashing. We assume there is no attribute then.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@342519 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ThreadSafetyCommon.cpp
test/SemaCXX/warn-thread-safety-analysis.cpp