From efbdbbb60bf48f29ed7cdef7e367ea6a89ab16fb Mon Sep 17 00:00:00 2001 From: Andy Ayers Date: Mon, 7 Feb 2022 19:22:45 -0800 Subject: [PATCH] JIT: fix containment safety check in LowerHWIntrinsicGetElement Missing call to IsSafeToContainMem was causing us to mistakenly think an operand was going to be contained when it wasn't. Fixes #64918 --- src/coreclr/jit/lowerxarch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/jit/lowerxarch.cpp b/src/coreclr/jit/lowerxarch.cpp index 515bae96c434c..663ac0cec3f6c 100644 --- a/src/coreclr/jit/lowerxarch.cpp +++ b/src/coreclr/jit/lowerxarch.cpp @@ -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);