diff options
Diffstat (limited to 'src/jit/optimizer.cpp')
-rw-r--r-- | src/jit/optimizer.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/jit/optimizer.cpp b/src/jit/optimizer.cpp index c18ebc55d0..710dac540c 100644 --- a/src/jit/optimizer.cpp +++ b/src/jit/optimizer.cpp @@ -7638,6 +7638,15 @@ bool Compiler::optExtractArrIndex(GenTreePtr tree, ArrIndex* result, unsigned lh { return false; } + + // For span we may see gtArrLen is a local var or local field. + // We won't try and extract those. + const genTreeOps arrayOp = arrBndsChk->gtArrLen->gtOper; + + if ((arrayOp == GT_LCL_VAR) || (arrayOp == GT_LCL_FLD)) + { + return false; + } if (arrBndsChk->gtArrLen->gtGetOp1()->gtOper != GT_LCL_VAR) { return false; |