Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

[x86/Linux] Fix dangling StubLinkerCPU::EmitDelegateInvoke in x86/Linux #8444

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/vm/comdelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2395,7 +2395,7 @@ PCODE COMDelegate::TheDelegateInvokeStub()
}
CONTRACT_END;

#ifdef _TARGET_X86_
#if defined(_TARGET_X86_) && !defined(FEATURE_STUBS_AS_IL)
static PCODE s_pInvokeStub;

if (s_pInvokeStub == NULL)
Expand All @@ -2415,7 +2415,7 @@ PCODE COMDelegate::TheDelegateInvokeStub()
RETURN s_pInvokeStub;
#else
RETURN GetEEFuncEntryPoint(SinglecastDelegateInvokeStub);
#endif // _TARGET_X86_
#endif // _TARGET_X86_ && !FEATURE_STUBS_AS_IL
}

// Get the cpu stub for a delegate invoke.
Expand Down
4 changes: 4 additions & 0 deletions src/vm/i386/cgencpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ EXTERN_C void STDCALL PInvokeStackImbalanceHelper(void);
EXTERN_C void STDCALL CopyCtorCallStub(void);
#endif // !FEATURE_CORECLR

#ifdef FEATURE_STUBS_AS_IL
EXTERN_C void SinglecastDelegateInvokeStub();
#endif // FEATURE_STUBS_AS_IL

BOOL Runtime_Test_For_SSE2();

#ifdef CROSSGEN_COMPILE
Expand Down
6 changes: 6 additions & 0 deletions src/vm/i386/stublinkerx86.h
Original file line number Diff line number Diff line change
Expand Up @@ -374,13 +374,16 @@ class StubLinkerCPU : public StubLinker
BOOL bShouldProfile);
#endif // FEATURE_COMINTEROP && _TARGET_X86_

#ifndef FEATURE_STUBS_AS_IL
//===========================================================================
// Computes hash code for MulticastDelegate.Invoke()
static UINT_PTR HashMulticastInvoke(MetaSig* pSig);

#ifdef _TARGET_X86_
//===========================================================================
// Emits code for Delegate.Invoke() any delegate type
VOID EmitDelegateInvoke();
#endif // _TARGET_X86_

//===========================================================================
// Emits code for MulticastDelegate.Invoke() - sig specific
Expand All @@ -389,6 +392,7 @@ class StubLinkerCPU : public StubLinker
//===========================================================================
// Emits code for Delegate.Invoke() on delegates that recorded creator assembly
VOID EmitSecureDelegateInvoke(UINT_PTR hash);
#endif // !FEATURE_STUBS_AS_IL

//===========================================================================
// Emits code to adjust for a static delegate target.
Expand All @@ -402,9 +406,11 @@ class StubLinkerCPU : public StubLinker
//Worker function to emit throw helpers for array ops.
VOID EmitArrayOpStubThrow(unsigned exConst, unsigned cbRetArg);

#ifndef FEATURE_STUBS_AS_IL
//===========================================================================
// Emits code to break into debugger
VOID EmitDebugBreak();
#endif // !FEATURE_STUBS_AS_IL

#if defined(_DEBUG) && (defined(_TARGET_AMD64_) || defined(_TARGET_X86_)) && !defined(FEATURE_PAL)
//===========================================================================
Expand Down