Skip to content

Commit cc768d2

Browse files
committed
Use unsigned casts for array length/index
1 parent 43eb602 commit cc768d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/coreclr/jit/morph.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5685,7 +5685,7 @@ GenTree* Compiler::fgMorphArrayIndex(GenTree* tree)
56855685

56865686
if (bndsChkType != TYP_INT)
56875687
{
5688-
arrLen = gtNewCastNode(bndsChkType, arrLen, false, bndsChkType);
5688+
arrLen = gtNewCastNode(bndsChkType, arrLen, true, bndsChkType);
56895689
}
56905690

56915691
GenTreeBoundsChk* arrBndsChk = new (this, GT_ARR_BOUNDS_CHECK)
@@ -5714,7 +5714,7 @@ GenTree* Compiler::fgMorphArrayIndex(GenTree* tree)
57145714
}
57155715
else
57165716
{
5717-
index = gtNewCastNode(TYP_I_IMPL, index, false, TYP_I_IMPL);
5717+
index = gtNewCastNode(TYP_I_IMPL, index, true, TYP_I_IMPL);
57185718
}
57195719
}
57205720
#endif // TARGET_64BIT

0 commit comments

Comments
 (0)