[all-commits] [llvm/llvm-project] 1c9f4d: [ARM] Avoid reference into modified vector (#93965)

Nikita Popov via All-commits all-commits at lists.llvm.org
Mon Jun 3 08:10:56 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1c9f4d4b6ffff86a681196d0a7e083e3eaeabaeb
      https://github.com/llvm/llvm-project/commit/1c9f4d4b6ffff86a681196d0a7e083e3eaeabaeb
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2024-06-03 (Mon, 03 Jun 2024)

  Changed paths:
    M llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
    M llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp

  Log Message:
  -----------
  [ARM] Avoid reference into modified vector (#93965)

FirstCand is a reference to RepeatedSequenceLocs[0]. However, that
vector is being modified a lot throughout the function, including one
place that reassigns the whole vector. I'm not sure whether this can
really happen in practice, but it doesn't seem unlikely that this could
lead to a use-after-free.

Avoid this by directly using RepeatedSequenceLocs[0] at the start of the
function (as a lot of other places already do) and only creating
FirstCand at the end where no more modifications take place.



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