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

Commit

Permalink
[x86/Linux] Fix crash when GC triggered inside funclets (#10188)
Browse files Browse the repository at this point in the history
* [x86/Linux] Fix crash when GC triggered inside funclets

* [x86/Linux] Make main function not to report
  • Loading branch information
wateret authored and janvorli committed Apr 4, 2017
1 parent dfce3af commit 8525460
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/vm/eetwain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4166,6 +4166,14 @@ bool EECodeManager::EnumGcRefs( PREGDISPLAY pContext,
GC_NOTRIGGER;
} CONTRACTL_END;

#ifdef WIN64EXCEPTIONS
if (flags & ParentOfFuncletStackFrame)
{
LOG((LF_GCROOTS, LL_INFO100000, "Not reporting this frame because it was already reported via another funclet.\n"));
return true;
}
#endif // WIN64EXCEPTIONS

GCInfoToken gcInfoToken = pCodeInfo->GetGCInfoToken();
unsigned curOffs = pCodeInfo->GetRelOffset();

Expand Down Expand Up @@ -4755,6 +4763,18 @@ bool EECodeManager::EnumGcRefs( PREGDISPLAY pContext,
_ASSERTE(*castto(table, unsigned short *)++ == 0xBABE);
#endif

#ifdef WIN64EXCEPTIONS // funclets
//
// If we're in a funclet, we do not want to report the incoming varargs. This is
// taken care of by the parent method and the funclet should access those arguments
// by way of the parent method's stack frame.
//
if(pCodeInfo->IsFunclet())
{
return true;
}
#endif // WIN64EXCEPTIONS

/* Are we a varargs function, if so we have to report all args
except 'this' (note that the GC tables created by the x86 jit
do not contain ANY arguments except 'this' (even if they
Expand Down

0 comments on commit 8525460

Please sign in to comment.