From 6fffd5d49d3224d2692e8bfe85630e61480d37c5 Mon Sep 17 00:00:00 2001 From: Steve MacLean Date: Wed, 1 Nov 2017 12:22:49 -0400 Subject: [PATCH] SIMD Handle negative indicies in get_Item --- src/jit/simd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jit/simd.cpp b/src/jit/simd.cpp index bb33fcd..def834b 100644 --- a/src/jit/simd.cpp +++ b/src/jit/simd.cpp @@ -2533,7 +2533,7 @@ GenTreePtr Compiler::impSIMDIntrinsic(OPCODE opcode, op2 = impSIMDPopStack(TYP_INT); op1 = impSIMDPopStack(simdType, instMethod); int vectorLength = getSIMDVectorLength(size, baseType); - if (!op2->IsCnsIntOrI() || op2->AsIntCon()->gtIconVal >= vectorLength) + if (!op2->IsCnsIntOrI() || op2->AsIntCon()->gtIconVal >= vectorLength || op2->AsIntCon()->gtIconVal < 0) { // We need to bounds-check the length of the vector. // For that purpose, we need to clone the index expression. -- 2.7.4