[all-commits] [llvm/llvm-project] 64c215: [Wunsafe-buffer-usage] Fix false positive when con...

Malavika Samak via All-commits all-commits at lists.llvm.org
Mon Jan 13 18:45:37 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 64c2156d8802b0d7724f65ce854844670e4ec457
      https://github.com/llvm/llvm-project/commit/64c2156d8802b0d7724f65ce854844670e4ec457
  Author: Malavika Samak <malavika.samak at gmail.com>
  Date:   2025-01-14 (Tue, 14 Jan 2025)

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

  Log Message:
  -----------
  [Wunsafe-buffer-usage] Fix false positive when const sized array is indexed by const evaluatable expressions (#119340)

Do not warn when constant sized array is indexed by expressions that
evaluate to a const value. For instance, sizeof(T) expression value can
be evaluated at compile time and if an array is indexed by such an
expression, it's bounds can be validated.

(rdar://140320289)

Co-authored-by: MalavikaSamak <malavika2 at apple.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list