Skip to content

Fix detection of exceptionally called funclet in stack walk #99958

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

Merged
Merged
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
6 changes: 4 additions & 2 deletions src/coreclr/vm/stackwalk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1907,9 +1907,11 @@ StackWalkAction StackFrameIterator::Filter(void)

if (g_isNewExceptionHandlingEnabled)
{
if (!m_fFoundFirstFunclet && pExInfo > (void*)GetRegdisplaySP(m_crawl.GetRegisterSet()))
if (!m_fFoundFirstFunclet && (pExInfo > (void*)GetRegdisplaySP(m_crawl.GetRegisterSet())) && ((void*)m_sfParent.SP > pExInfo))
{
// For the first funclet we encounter below the topmost ExInfo, we instruct the GC scanning of the frame
// For the first funclet we encounter below the topmost ExInfo that has a parent above that ExInfo
// (so it is an exceptionally called funclet for the exception represented by the ExInfo),
// we instruct the GC scanning of the frame
// to save information on the funclet so that we can use it to report references in the parent frame if
// no such funclet is found in future GC scans for the same exception.
_ASSERTE(pExInfo != NULL);
Expand Down