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

Commit

Permalink
Fix dangling StubLinkerCPU::EmitDelegateInvoke in x86/Linux (#8444)
Browse files Browse the repository at this point in the history
Several methods in StublicLinkerCPU (including EmitDelegateInvoke) are
available only when FEATURE_STUBS_AS_IL is defined.

This commit encloses their declaration with appropriate macro
(FEATURE_STUBS_AS_IL), and fix related build erros.
  • Loading branch information
parjong authored and janvorli committed Dec 5, 2016
1 parent 0c952dc commit 14bcf6d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
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 @@ -377,13 +377,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 @@ -392,6 +395,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 @@ -405,9 +409,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

0 comments on commit 14bcf6d

Please sign in to comment.