[PATCH] D144064: [WIP][-Wunsafe-buffer-usage] Match unsafe pointers being casted to bool or participating in pointer subtractions

Ziqing Luo via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 14 18:15:08 PST 2023


ziqingluo-90 created this revision.
ziqingluo-90 added reviewers: jkorous, NoQ, malavikasamak, t-rasmud.
Herald added a project: All.
ziqingluo-90 requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

To add two new unique cases to the Unspecified Pointer Context (UPC):

- A pointer being casted to a boolean value is in a UPC;
- A pointer participating in pointer subtraction is in a UPC.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D144064

Files:
  clang/lib/Analysis/UnsafeBufferUsage.cpp
  clang/test/SemaCXX/warn-unsafe-buffer-usage-fixits-addressof-arraysubscript.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144064.497514.patch
Type: text/x-patch
Size: 5220 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230215/0227522b/attachment-0001.bin>


More information about the cfe-commits mailing list