[PATCH] D70470: [analyzer] Add FuchsiaHandleCheck to catch handle leaks, use after frees and double frees

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 19 15:37:14 PST 2019


xazax.hun created this revision.
xazax.hun added reviewers: NoQ, haowei.
xazax.hun added a project: clang.
Herald added subscribers: Charusso, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, whisperity, mgorny.

This check is based on https://reviews.llvm.org/D36022 but it takes a bit different approach. It does less state splitting and tries to avoid the evalCall callback. The state machine is also a bit different, now the escaped and untracked states are merged.

There were some problems in the original patch with non-pointer escapes. I did not really see those problems with my current model (which is slightly different) but there might be some skeletons waiting to fall out.

Disclaimer: this patch will not apply cleanly on top of tree just yet. There are some dependencies that I plan to upload soon, but in the meantime I wanted this to be available for review.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D70470

Files:
  clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
  clang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
  clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt
  clang/lib/StaticAnalyzer/Checkers/FuchsiaHandleChecker.cpp
  clang/test/Analysis/fuchsia_handle.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70470.230160.patch
Type: text/x-patch
Size: 23896 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191119/d565b86f/attachment-0001.bin>


More information about the cfe-commits mailing list