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)
commitf6ccde781004295dc031b86ee1f19a367130db70
treee55e816118d1c49819c0babce007f9b16713904a
parentb64f71b0296f45bd2a527a5da37b2692f665fcb3
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.

llvm-svn: 342519
clang/lib/Analysis/ThreadSafetyCommon.cpp
clang/test/SemaCXX/warn-thread-safety-analysis.cpp