[all-commits] [llvm/llvm-project] db0e75: [clang-tidy] Fix crash in bugprone-misplaced-point...

Zeyi Xu via All-commits all-commits at lists.llvm.org
Fri Sep 18 04:00:34 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: db0e752a8833b933b41ec15d8311b37d125f655d
      https://github.com/llvm/llvm-project/commit/db0e752a8833b933b41ec15d8311b37d125f655d
  Author: Zeyi Xu <zeyi2 at nekoarch.cc>
  Date:   2026-09-18 (Fri, 18 Sep 2026)

  Changed paths:
    M clang-tools-extra/clang-tidy/bugprone/MisplacedPointerArithmeticInAllocCheck.cpp
    M clang-tools-extra/docs/ReleaseNotes.md
    M clang-tools-extra/test/clang-tidy/checkers/bugprone/misplaced-pointer-arithmetic-in-alloc.cpp

  Log Message:
  -----------
  [clang-tidy] Fix crash in bugprone-misplaced-pointer-arithmetic-in-alloc (#224509)

This commit checks for an empty constructor argument list before
accessing its last element.

Reproducer at: https://godbolt.org/z/Tfvnbhx19

AI Usage: the issue was found by Grok 4.6. Although IMO this is a pretty
uncommon/rare case, less crash-on-valid is always better.



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