[all-commits] [llvm/llvm-project] da959c: [flang] Fixed out-of-bounds access in SimplifyIntr...

Slava Zakharin via All-commits all-commits at lists.llvm.org
Thu Apr 17 11:46:27 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: da959c92c5a46abd59d38d26d5e0758d48fb7f65
      https://github.com/llvm/llvm-project/commit/da959c92c5a46abd59d38d26d5e0758d48fb7f65
  Author: Slava Zakharin <szakharin at nvidia.com>
  Date:   2025-04-17 (Thu, 17 Apr 2025)

  Changed paths:
    M flang/lib/Optimizer/Transforms/SimplifyIntrinsics.cpp
    M flang/test/Transforms/simplifyintrinsics.fir

  Log Message:
  -----------
  [flang] Fixed out-of-bounds access in SimplifyIntrinsics. (#136171)

When the mask is scalar, it is incorrect to cast it to
!fir.box<!fir.array<1xlogical<>>>, because the coordinate
operation will try to read the dim-1 stride from the box
to get the address of the first element. Even though
the stride value will be multiplied by 0, and does not matter,
it is still a read past the allocated box object.
Instead, we should just use box_addr to get the address
of the scalar mask.



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