Skip to content

Commit

Permalink
JIT: fix containment safety check in LowerHWIntrinsicGetElement
Browse files Browse the repository at this point in the history
Missing call to IsSafeToContainMem was causing us to mistakenly think
an operand was going to be contained when it wasn't.

Fixes dotnet#64918
  • Loading branch information
AndyAyersMS committed Feb 8, 2022
1 parent ec4d084 commit efbdbbb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/coreclr/jit/lowerxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2512,7 +2512,7 @@ void Lowering::LowerHWIntrinsicGetElement(GenTreeHWIntrinsic* node)

assert(0 <= imm8 && imm8 < count);

if (IsContainableMemoryOp(op1))
if (IsContainableMemoryOp(op1) && IsSafeToContainMem(node, op1))
{
// We will specially handle GetElement in codegen when op1 is already in memory
op2->AsIntCon()->SetIconValue(imm8);
Expand Down

0 comments on commit efbdbbb

Please sign in to comment.