Skip to content

Commit 6aecb65

Browse files
authored
Fix GCInfoDumper (#122682)
Delete obsolete offset adjustments from a few more places
1 parent 023ad3f commit 6aecb65

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/coreclr/gcinfo/gcinfodumper.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,10 @@ PORTABILITY_ASSERT("GcInfoDumper::EnumerateStateChanges is not implemented on th
865865
#ifdef PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED
866866
UINT32 safePointOffset = offset;
867867
#if defined(TARGET_AMD64) || defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_RISCV64) || defined(TARGET_LOONGARCH64)
868-
safePointOffset++;
868+
if (safePointDecoder.Version() < 4)
869+
{
870+
safePointOffset++;
871+
}
869872
#endif
870873
if(safePointDecoder.IsSafePoint(safePointOffset))
871874
{

src/coreclr/vm/gcinfodecoder.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -385,18 +385,17 @@ TGcInfoDecoder<GcInfoEncoding>::TGcInfoDecoder(
385385
{
386386
if(m_NumSafePoints)
387387
{
388+
UINT32 offset = m_InstructionOffset;
388389
#ifdef DECODE_OLD_FORMATS
389-
if (Version() < 4)
390+
if (Version() < 4 && (flags & DECODE_INTERRUPTIBILITY))
390391
{
391392
// Safepoints are encoded with a -1 adjustment
392393
// DECODE_GC_LIFETIMES adjusts the offset accordingly, but DECODE_INTERRUPTIBILITY does not
393394
// adjust here
394-
UINT32 offset = flags & DECODE_INTERRUPTIBILITY ? m_InstructionOffset - 1 : m_InstructionOffset;
395-
m_SafePointIndex = FindSafePoint(offset);
395+
offset--;
396396
}
397-
#else
398-
m_SafePointIndex = FindSafePoint(m_InstructionOffset);
399397
#endif
398+
m_SafePointIndex = FindSafePoint(offset);
400399
}
401400
}
402401
else if(flags & DECODE_FOR_RANGES_CALLBACK)

0 commit comments

Comments
 (0)