[PATCH] D131009: [analyzer] Fixing a bug raising false positives of stack block object leaking under ARC

Ziqing Luo via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 16 15:55:17 PDT 2022


ziqingluo-90 updated this revision to Diff 453144.
ziqingluo-90 added a comment.

Addressing @NoQ 's comment.  Let the symbolic execution simulator put a block object in an `UnknownSpaceRegion` from the start if ARC is enabled.  Because in such cases whether the block is on stack or in heap depends on the implementation.  And, those blocks will be moved to the heap when necessary.   So they will never trigger a stack address leak issue.

Removing those ARC checking in `StackAddrEscapeChecker` since they are no longer needed.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131009/new/

https://reviews.llvm.org/D131009

Files:
  clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp
  clang/lib/StaticAnalyzer/Core/MemRegion.cpp
  clang/test/Analysis/stack-capture-leak-arc.mm
  clang/test/Analysis/stack-capture-leak-no-arc.mm

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131009.453144.patch
Type: text/x-patch
Size: 6958 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220816/4f91d9c6/attachment-0001.bin>


More information about the cfe-commits mailing list