Skip to content

Commit 274b760

Browse files
author
Mike McLaughlin
committed
Add comments and fix FaultingExceptionFrame on amd64
1 parent 6dccf12 commit 274b760

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/coreclr/vm/amd64/asmconstants.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,11 +449,11 @@ ASMCONSTANTS_C_ASSERT(OFFSETOF__CONTEXT__VectorRegister
449449
ASMCONSTANTS_C_ASSERT(SIZEOF__FaultingExceptionFrame
450450
== sizeof(FaultingExceptionFrame));
451451

452-
#define OFFSETOF__FaultingExceptionFrame__m_fFilterExecuted 0x10
452+
#define OFFSETOF__FaultingExceptionFrame__m_fFilterExecuted (SIZEOF__Frame + 0x8)
453453
ASMCONSTANTS_C_ASSERT(OFFSETOF__FaultingExceptionFrame__m_fFilterExecuted
454454
== offsetof(FaultingExceptionFrame, m_fFilterExecuted));
455455

456-
#define OFFSETOF__FaultingExceptionFrame__m_SSP (0x20 + SIZEOF__CONTEXT)
456+
#define OFFSETOF__FaultingExceptionFrame__m_SSP (SIZEOF__Frame)
457457
ASMCONSTANTS_C_ASSERT(OFFSETOF__FaultingExceptionFrame__m_SSP
458458
== offsetof(FaultingExceptionFrame, m_SSP));
459459

src/coreclr/vm/frames.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -933,6 +933,10 @@ class FaultingExceptionFrame : public Frame
933933
{
934934
friend class CheckAsmOffsets;
935935

936+
#ifdef TARGET_AMD64
937+
TADDR m_SSP;
938+
#endif
939+
936940
#ifndef FEATURE_EH_FUNCLETS
937941
#ifdef TARGET_X86
938942
DWORD m_Esp;
@@ -944,13 +948,11 @@ class FaultingExceptionFrame : public Frame
944948
#else // FEATURE_EH_FUNCLETS
945949
BOOL m_fFilterExecuted; // Flag for FirstCallToHandler
946950
TADDR m_ReturnAddress;
951+
// This T_CONTEXT field needs to be the last field in the class because it is a
952+
// different size between Linux (pal.h) and the Windows cross-DAC (winnt.h).
947953
T_CONTEXT m_ctx;
948954
#endif // !FEATURE_EH_FUNCLETS
949955

950-
#ifdef TARGET_AMD64
951-
TADDR m_SSP;
952-
#endif
953-
954956
public:
955957
#ifndef DACCESS_COMPILE
956958
FaultingExceptionFrame() : Frame(FrameIdentifier::FaultingExceptionFrame) {
@@ -1042,6 +1044,8 @@ class SoftwareExceptionFrame : public Frame
10421044
{
10431045
TADDR m_ReturnAddress;
10441046
T_KNONVOLATILE_CONTEXT_POINTERS m_ContextPointers;
1047+
// This T_CONTEXT field needs to be the last field in the class because it is a
1048+
// different size between Linux (pal.h) and the Windows cross-DAC (winnt.h).
10451049
T_CONTEXT m_Context;
10461050

10471051
public:

0 commit comments

Comments
 (0)