summaryrefslogtreecommitdiff
path: root/src/jit/simd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/jit/simd.cpp')
-rw-r--r--src/jit/simd.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/jit/simd.cpp b/src/jit/simd.cpp
index bb33fcd636..def834b76a 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.