[all-commits] [llvm/llvm-project] 88f7f0: [-Wunsafe-buffer-usage] Match unsafe pointers bein...

Ziqing Luo via All-commits all-commits at lists.llvm.org
Tue Apr 11 15:10:42 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 88f7f018e23b24d3c31dd2b4f3cd68481d1739c1
      https://github.com/llvm/llvm-project/commit/88f7f018e23b24d3c31dd2b4f3cd68481d1739c1
  Author: Ziqing Luo <ziqing at udel.edu>
  Date:   2023-04-11 (Tue, 11 Apr 2023)

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

  Log Message:
  -----------
  [-Wunsafe-buffer-usage] Match unsafe pointers being casted to bool or participating in pointer subtractions

Add two new unique cases to the Unspecified Pointer Context (UPC),
under which we match unsafe operation patterns:
- A pointer being casted to a boolean value is in a UPC;
- A pointer participating in pointer subtraction is in a UPC.

Reviewed by: NoQ (Artem Dergachev), malavikasamak (Malavika Samak)

Differential revision: https://reviews.llvm.org/D144064




More information about the All-commits mailing list