-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Fix Thread::IsAddressInStack for interpreter #116818
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7784,8 +7784,47 @@ InterpThreadContext* Thread::GetInterpThreadContext() | |
} | ||
#endif // FEATURE_INTERPRETER | ||
|
||
/* static */ | ||
BOOL Thread::IsAddressInCurrentStack(PTR_VOID addr) | ||
{ | ||
LIMITED_METHOD_DAC_CONTRACT; | ||
Thread* currentThread = GetThreadNULLOk(); | ||
if (currentThread == NULL) | ||
{ | ||
return FALSE; | ||
} | ||
|
||
#ifdef FEATURE_INTERPRETER | ||
InterpThreadContext* pInterpThreadContext = currentThread->m_pInterpThreadContext; | ||
if ((pInterpThreadContext != NULL) && ((PTR_VOID)pInterpThreadContext->pStackStart < addr) && (addr <= (PTR_VOID)pInterpThreadContext->pStackPointer)) | ||
{ | ||
return true; | ||
} | ||
#endif // FEATURE_INTERPRETER | ||
|
||
PTR_VOID sp = dac_cast<PTR_VOID>(GetCurrentSP()); | ||
_ASSERTE(currentThread->m_CacheStackBase != NULL); | ||
_ASSERTE(sp < currentThread->m_CacheStackBase); | ||
return sp < addr && addr <= currentThread->m_CacheStackBase; | ||
} | ||
|
||
#endif // #ifndef DACCESS_COMPILE | ||
|
||
BOOL Thread::IsAddressInStack (PTR_VOID addr) const | ||
{ | ||
LIMITED_METHOD_DAC_CONTRACT; | ||
_ASSERTE(m_CacheStackBase != NULL); | ||
_ASSERTE(m_CacheStackLimit != NULL); | ||
_ASSERTE(m_CacheStackLimit < m_CacheStackBase); | ||
#ifdef FEATURE_INTERPRETER | ||
if ((m_pInterpThreadContext != NULL) && ((PTR_VOID)m_pInterpThreadContext->pStackStart < addr) && (addr <= (PTR_VOID)m_pInterpThreadContext->pStackPointer)) | ||
|
||
{ | ||
return TRUE; | ||
} | ||
#endif // FEATURE_INTERPRETER | ||
return m_CacheStackLimit < addr && addr <= m_CacheStackBase; | ||
} | ||
|
||
#ifdef DACCESS_COMPILE | ||
|
||
void | ||
|
Uh oh!
There was an error while loading. Please reload this page.