Skip to content

Commit a257f58

Browse files
committed
Reflect PR feedback
* Change the GET_CALLER_SP to assert and return NULL * Remove extra assert at the call to GET_CALLER_SP * Revert some changes removing "virtual" keyword that were not intentional
1 parent bb4af84 commit a257f58

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

src/coreclr/inc/eetwain.h

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -442,10 +442,12 @@ void LightUnwindStackFrame(
442442
Is the function currently at a "GC safe point" ?
443443
Can call EnumGcRefs() successfully
444444
*/
445+
virtual
445446
bool IsGcSafe( EECodeInfo *pCodeInfo,
446447
DWORD dwRelOffset);
447448

448449
#if defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_LOONGARCH64) || defined(TARGET_RISCV64)
450+
virtual
449451
bool HasTailCalls(EECodeInfo *pCodeInfo);
450452
#endif // TARGET_ARM || TARGET_ARM64 || TARGET_LOONGARCH64 || defined(TARGET_RISCV64)
451453

@@ -456,6 +458,7 @@ bool HasTailCalls(EECodeInfo *pCodeInfo);
456458
object have to be individually enumerated).
457459
Returns success of operation.
458460
*/
461+
virtual
459462
bool EnumGcRefs(PREGDISPLAY pContext,
460463
EECodeInfo *pCodeInfo,
461464
unsigned flags,
@@ -473,6 +476,7 @@ bool EnumGcRefsConservative(PREGDISPLAY pRD,
473476
LPVOID hCallBack);
474477
#endif // FEATURE_CONSERVATIVE_GC
475478

479+
virtual
476480
OBJECTREF GetInstance(
477481
PREGDISPLAY pContext,
478482
EECodeInfo * pCodeInfo);
@@ -485,8 +489,8 @@ PTR_VOID GetParamTypeArg(PREGDISPLAY pContext,
485489
EECodeInfo * pCodeInfo);
486490

487491
// Returns the type of the context parameter (this, methodtable, methoddesc, or none)
488-
GenericParamContextType GetParamContextType(PREGDISPLAY pContext,
489-
EECodeInfo * pCodeInfo);
492+
virtual GenericParamContextType GetParamContextType(PREGDISPLAY pContext,
493+
EECodeInfo * pCodeInfo);
490494

491495
#if defined(FEATURE_EH_FUNCLETS) && defined(USE_GC_INFO_DECODER)
492496
/*
@@ -507,6 +511,7 @@ PTR_VOID GetExactGenericsToken(SIZE_T baseStackSlot,
507511
Returns the offset of the GuardStack cookie if it exists.
508512
Returns NULL if there is no cookie.
509513
*/
514+
virtual
510515
void * GetGSCookieAddr(PREGDISPLAY pContext,
511516
EECodeInfo * pCodeInfo,
512517
unsigned flags,
@@ -517,6 +522,7 @@ void * GetGSCookieAddr(PREGDISPLAY pContext,
517522
/*
518523
Returns true if the given IP is in the given method's prolog or an epilog.
519524
*/
525+
virtual
520526
bool IsInPrologOrEpilog(
521527
DWORD relOffset,
522528
GCInfoToken gcInfoToken,
@@ -525,7 +531,7 @@ bool IsInPrologOrEpilog(
525531
/*
526532
Returns true if the given IP is in the synchronized region of the method (valid for synchronized functions only)
527533
*/
528-
bool IsInSynchronizedRegion(
534+
virtual bool IsInSynchronizedRegion(
529535
DWORD relOffset,
530536
GCInfoToken gcInfoToken,
531537
unsigned flags);
@@ -534,6 +540,7 @@ bool IsInSynchronizedRegion(
534540
/*
535541
Returns the size of a given function.
536542
*/
543+
virtual
537544
size_t GetFunctionSize(GCInfoToken gcInfoToken);
538545

539546
/*

src/coreclr/vm/gcinfodecoder.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
#ifndef GET_CALLER_SP
2222
inline size_t GET_CALLER_SP(PREGDISPLAY pREGDISPLAY)
2323
{
24-
_ASSERTE(pREGDISPLAY->IsCallerContextValid);
25-
return (size_t)GetSP(pREGDISPLAY->pCallerContext);
24+
_ASSERTE(false);
25+
return NULL;
2626
}
2727
#endif // !GET_CALLER_SP
2828

@@ -2144,9 +2144,6 @@ template <typename GcInfoEncoding> OBJECTREF* TGcInfoDecoder<GcInfoEncoding>::Ge
21442144
}
21452145
else if( GC_CALLER_SP_REL == spBase )
21462146
{
2147-
#ifndef FEATURE_NATIVEAOT
2148-
_ASSERTE(pRD->IsCallerContextValid);
2149-
#endif
21502147
pObjRef = (OBJECTREF*) (GET_CALLER_SP(pRD) + spOffset);
21512148
}
21522149
else

0 commit comments

Comments
 (0)