[PATCH] D37812: [analyzer] PthreadLock: Escape the pointers.

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 13 09:16:15 PDT 2017


NoQ created this revision.

As usual, we need to invalidate mutex states when something may touch them. Implement this boilerplate for the thread lock checker.

The previous refactoring is handy for listing functions on which we don't need to invalidate mutex states because we model them instead.

Additionally, i don't invalidate mutex states when any system header function is called, unless the mutex is passed directly into it. The TODO here would be to model *all* system functions that may change mutex states, and then disable invalidation for the rest of them even if they take a mutex; that's what other checkers do.


https://reviews.llvm.org/D37812

Files:
  lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp
  test/Analysis/Inputs/system-header-simulator-for-pthread-lock.h
  test/Analysis/pthreadlock.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37812.115053.patch
Type: text/x-patch
Size: 4413 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170913/b4c1a27b/attachment.bin>


More information about the cfe-commits mailing list