@@ -432,8 +432,6 @@ PCODE MethodDesc::PrepareILBasedCode(PrepareCodeConfig* pConfig)
432432#ifdef FEATURE_INTERPRETER
433433 if (pConfig->IsInterpreterCode ())
434434 {
435- CreateNativeToInterpreterCallStub (pCode);
436-
437435 AllocMemTracker amt;
438436 InterpreterPrecode* pPrecode = Precode::AllocateInterpreterPrecode (pCode, GetLoaderAllocator (), &amt);
439437 amt.SuppressRelease ();
@@ -2183,12 +2181,15 @@ PCODE MethodDesc::DoPrestub(MethodTable *pDispatchingMT, CallerGCMode callerGCMo
21832181
21842182 if (doBackpatch)
21852183 {
2186- RETURN DoBackpatch (pMT, pDispatchingMT, doFullBackpatch);
2184+ pCode = DoBackpatch (pMT, pDispatchingMT, doFullBackpatch);
2185+ }
2186+ else
2187+ {
2188+ _ASSERTE (!doFullBackpatch);
21872189 }
21882190
21892191 _ASSERTE (pCode != (PCODE)NULL );
2190- _ASSERTE (!doFullBackpatch);
2191- RETURN pCode;
2192+ goto Return;
21922193 }
21932194#endif
21942195
@@ -2200,7 +2201,8 @@ PCODE MethodDesc::DoPrestub(MethodTable *pDispatchingMT, CallerGCMode callerGCMo
22002201 MarkMethodNotPitchingCandidate (this );
22012202 #endif
22022203
2203- RETURN DoBackpatch (pMT, pDispatchingMT, TRUE );
2204+ pCode = DoBackpatch (pMT, pDispatchingMT, TRUE );
2205+ goto Return;
22042206 }
22052207
22062208 /* ************************* CODE CREATION *************************/
@@ -2322,7 +2324,19 @@ PCODE MethodDesc::DoPrestub(MethodTable *pDispatchingMT, CallerGCMode callerGCMo
23222324 _ASSERTE (!IsPointingToPrestub ());
23232325 _ASSERTE (HasStableEntryPoint ());
23242326
2325- RETURN DoBackpatch (pMT, pDispatchingMT, FALSE );
2327+
2328+ pCode = DoBackpatch (pMT, pDispatchingMT, FALSE );
2329+
2330+ Return:
2331+ #ifdef FEATURE_INTERPRETER
2332+ InterpByteCodeStart *pInterpreterCode = GetInterpreterCode ();
2333+ if (pInterpreterCode != NULL )
2334+ {
2335+ CreateNativeToInterpreterCallStub (pInterpreterCode->Method );
2336+ }
2337+ #endif // FEATURE_INTERPRETER
2338+
2339+ RETURN pCode;
23262340}
23272341
23282342#endif // !DACCESS_COMPILE
0 commit comments