Files
clang-p2996/flang/lib/Optimizer/Transforms/SimplifyIntrinsics.cpp
Slava Zakharin da959c92c5 [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.
2025-04-17 11:46:06 -07:00

59 KiB