[PATCH] D139233: [-Wunsafe-buffer-usage] Add an unsafe gadget for pointer-arithmetic operations

Ziqing Luo via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 2 15:03:02 PST 2022


ziqingluo-90 created this revision.
ziqingluo-90 added reviewers: aaron.ballman, xazax.hun, steakhal, gribozavr, jkorous, NoQ, malavikasamak, t-rasmud.
Herald added a subscriber: rnkovacs.
Herald added a project: All.
ziqingluo-90 requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

For `-Wunsafe-buffer-usage` diagnostics, we want to warn about pointer arithmetics since resulting pointers can be used to access buffers.
Therefore, I add an `UnsafeGadget` representing general pointer arithmetic operations.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D139233

Files:
  clang/include/clang/Analysis/Analyses/UnsafeBufferUsageGadgets.def
  clang/lib/Analysis/UnsafeBufferUsage.cpp
  clang/test/SemaCXX/warn-unsafe-buffer-usage.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139233.479751.patch
Type: text/x-patch
Size: 5590 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221202/c9823ba0/attachment.bin>


More information about the cfe-commits mailing list