From 11112dfdcd66f9277d88f886f3a1616f80af40a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomek=20Sowi=C5=84ski?= Date: Fri, 24 Jan 2025 13:01:20 +0100 Subject: [PATCH] Fix reversed code offsets in GcInfo --- .../aot/ILCompiler.Reflection.ReadyToRun/Amd64/GcInfo.cs | 4 ++-- .../ILCompiler.Reflection.ReadyToRun/Amd64/GcTransition.cs | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/Amd64/GcInfo.cs b/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/Amd64/GcInfo.cs index 860a18b73565a2..a64ae72b6cd4e0 100644 --- a/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/Amd64/GcInfo.cs +++ b/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/Amd64/GcInfo.cs @@ -381,8 +381,8 @@ private List EnumerateInterruptibleRanges(byte[] image, int uint normRangeStartOffset = normLastinterruptibleRangeStopOffset + normStartDelta; uint normRangeStopOffset = normRangeStartOffset + normStopDelta; - uint rangeStartOffset = _gcInfoTypes.DenormalizeCodeOffset(normRangeStopOffset); - uint rangeStopOffset = _gcInfoTypes.DenormalizeCodeOffset(normRangeStartOffset); + uint rangeStartOffset = _gcInfoTypes.DenormalizeCodeOffset(normRangeStartOffset); + uint rangeStopOffset = _gcInfoTypes.DenormalizeCodeOffset(normRangeStopOffset); ranges.Add(new InterruptibleRange(i, rangeStartOffset, rangeStopOffset)); normLastinterruptibleRangeStopOffset = normRangeStopOffset; diff --git a/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/Amd64/GcTransition.cs b/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/Amd64/GcTransition.cs index 68e4385e1992d9..749f7e48f22e2f 100644 --- a/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/Amd64/GcTransition.cs +++ b/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/Amd64/GcTransition.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Reflection.PortableExecutable; using System.Text; @@ -16,6 +17,7 @@ public struct InterruptibleRange public InterruptibleRange(uint index, uint start, uint stop) { Index = index; + Debug.Assert(start <= stop); StartOffset = start; StopOffset = stop; }