Skip to content

Commit 6c73c19

Browse files
authored
Fix reversed code offsets in GcInfo (#111792)
1 parent 6acb17a commit 6c73c19

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/Amd64/GcInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,8 @@ private List<InterruptibleRange> EnumerateInterruptibleRanges(byte[] image, int
381381
uint normRangeStartOffset = normLastinterruptibleRangeStopOffset + normStartDelta;
382382
uint normRangeStopOffset = normRangeStartOffset + normStopDelta;
383383

384-
uint rangeStartOffset = _gcInfoTypes.DenormalizeCodeOffset(normRangeStopOffset);
385-
uint rangeStopOffset = _gcInfoTypes.DenormalizeCodeOffset(normRangeStartOffset);
384+
uint rangeStartOffset = _gcInfoTypes.DenormalizeCodeOffset(normRangeStartOffset);
385+
uint rangeStopOffset = _gcInfoTypes.DenormalizeCodeOffset(normRangeStopOffset);
386386
ranges.Add(new InterruptibleRange(i, rangeStartOffset, rangeStopOffset));
387387

388388
normLastinterruptibleRangeStopOffset = normRangeStopOffset;

src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/Amd64/GcTransition.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
using System;
55
using System.Collections.Generic;
6+
using System.Diagnostics;
67
using System.Reflection.PortableExecutable;
78
using System.Text;
89

@@ -16,6 +17,7 @@ public struct InterruptibleRange
1617
public InterruptibleRange(uint index, uint start, uint stop)
1718
{
1819
Index = index;
20+
Debug.Assert(start <= stop);
1921
StartOffset = start;
2022
StopOffset = stop;
2123
}

0 commit comments

Comments
 (0)