File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1504,7 +1504,9 @@ VOID StubLinkerCPU::EmitShuffleThunk(ShuffleEntry *pShuffleEntryArray)
15041504 DWORD dwSrcIndex = pEntry->srcofs & ShuffleEntry::OFSMASK;
15051505 if (dwSrcIndex != (dwLastSrcIndex + 1 ))
15061506 {
1507- _ASSERTE (dwSrcIndex > dwLastSrcIndex);
1507+ // If the gap is at the very beginning, then dwLastSrcIndex is still -1, so we need to allow
1508+ // for that. Note that the calculation below handles this properly, due to DWORD wrapping.
1509+ _ASSERTE ((dwLastSrcIndex == (DWORD)-1 ) || (dwSrcIndex > dwLastSrcIndex));
15081510
15091511 // add r4, #gap_size
15101512 ThumbEmitIncrement (ThumbReg (4 ), (dwSrcIndex - dwLastSrcIndex - 1 ) * 4 );
@@ -1528,7 +1530,9 @@ VOID StubLinkerCPU::EmitShuffleThunk(ShuffleEntry *pShuffleEntryArray)
15281530 DWORD dwDstIndex = pEntry->dstofs & ShuffleEntry::OFSMASK;
15291531 if (dwDstIndex != (dwLastDstIndex + 1 ))
15301532 {
1531- _ASSERTE (dwDstIndex > dwLastDstIndex);
1533+ // If the gap is at the very beginning, then dwLastDstIndex is still -1, so we need to allow
1534+ // for that. Note that the calculation below handles this properly, due to DWORD wrapping.
1535+ _ASSERTE ((dwLastDstIndex == (DWORD)-1 ) || (dwDstIndex > dwLastDstIndex));
15321536
15331537 // add r5, #gap_size
15341538 ThumbEmitIncrement (ThumbReg (5 ), (dwDstIndex - dwLastDstIndex - 1 ) * 4 );
You can’t perform that action at this time.
0 commit comments