diff options
author | Gabor Horvath <xazax@google.com> | 2019-11-15 16:00:46 -0800 |
---|---|---|
committer | Gabor Horvath <xazax@google.com> | 2019-12-20 12:33:16 -0800 |
commit | 82923c71efa57600d015dbc281202941d3d64dde (patch) | |
tree | 80124fceb361f2d5a2847242e4b25bd36fff4530 /clang/docs | |
parent | 07861e955d0095f25639d84c5726c73b528567cb (diff) | |
download | bcm5719-llvm-82923c71efa57600d015dbc281202941d3d64dde.tar.gz bcm5719-llvm-82923c71efa57600d015dbc281202941d3d64dde.zip |
[analyzer] Add Fuchsia Handle checker
The checker can diagnose handle use after releases, double releases, and
handle leaks.
Differential Revision: https://reviews.llvm.org/D70470
Diffstat (limited to 'clang/docs')
-rw-r--r-- | clang/docs/analyzer/checkers.rst | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/clang/docs/analyzer/checkers.rst b/clang/docs/analyzer/checkers.rst index b410c085878..34d29ba344c 100644 --- a/clang/docs/analyzer/checkers.rst +++ b/clang/docs/analyzer/checkers.rst @@ -1335,6 +1335,31 @@ Warns if 'CFArray', 'CFDictionary', 'CFSet' are created with non-pointer-size va &kCFTypeArrayCallBacks); // warn } +Fuchsia +^^^^^^^ + +Fuchsia is an open source capability-based operating system currently being +developed by Google. This section describes checkers that can find various +misuses of Fuchsia APIs. + +.. _fuchsia-HandleChecker: + +fuchsia.HandleChecker +"""""""""""""""""""""""""""" +Handles identify resources. Similar to pointers they can be leaked, +double freed, or use after freed. This check attempts to find such problems. + +.. code-block:: cpp + + void checkLeak08(int tag) { + zx_handle_t sa, sb; + zx_channel_create(0, &sa, &sb); + if (tag) + zx_handle_close(sa); + use(sb); // Warn: Potential leak of handle + zx_handle_close(sb); + } + .. _alpha-checkers: |