@@ -84,6 +84,12 @@ struct ThisPtrRetBufPrecode;
8484typedef DPTR (class UMEntryThunk ) PTR_UMEntryThunk;
8585#define PRECODE_UMENTRY_THUNK_VALUE 0x7 // Define the value here and not in UMEntryThunk to avoid circular dependency with the dllimportcallback.h header
8686
87+ #ifdef FEATURE_INTERPRETER
88+ struct InterpreterPrecode ;
89+
90+ typedef DPTR (InterpreterPrecode) PTR_InterpreterPrecode;
91+ #endif
92+
8793// Regular precode
8894struct StubPrecode
8995{
@@ -122,6 +128,10 @@ struct StubPrecode
122128 ThisPtrRetBufPrecode* AsThisPtrRetBufPrecode ();
123129#endif // HAS_THISPTR_RETBUF_PRECODE
124130
131+ #ifdef FEATURE_INTERPRETER
132+ PTR_InterpreterPrecode AsInterpreterPrecode ();
133+ #endif // FEATURE_INTERPRETER
134+
125135#ifndef DACCESS_COMPILE
126136 void SetSecretParam (TADDR secretParam)
127137 {
@@ -340,7 +350,13 @@ struct InterpreterPrecode
340350 TADDR GetMethodDesc ();
341351};
342352
343- typedef DPTR (InterpreterPrecode) PTR_InterpreterPrecode;
353+ inline PTR_InterpreterPrecode StubPrecode::AsInterpreterPrecode ()
354+ {
355+ LIMITED_METHOD_CONTRACT;
356+ SUPPORTS_DAC;
357+
358+ return dac_cast<PTR_InterpreterPrecode>(this );
359+ }
344360
345361#endif // FEATURE_INTERPRETER
346362
@@ -509,10 +525,11 @@ inline TADDR StubPrecode::GetMethodDesc()
509525 case PRECODE_PINVOKE_IMPORT:
510526 return GetSecretParam ();
511527
512- case PRECODE_UMENTRY_THUNK:
513528#ifdef FEATURE_INTERPRETER
514529 case PRECODE_INTERPRETER:
530+ return AsInterpreterPrecode ()->GetMethodDesc ();
515531#endif // FEATURE_INTERPRETER
532+ case PRECODE_UMENTRY_THUNK:
516533#ifdef FEATURE_STUBPRECODE_DYNAMIC_HELPERS
517534 case PRECODE_DYNAMIC_HELPERS:
518535#endif // FEATURE_STUBPRECODE_DYNAMIC_HELPERS
0 commit comments