@@ -368,15 +368,23 @@ bool UnixNativeCodeManager::UnwindStackFrame(MethodInfo * pMethodInfo,
368368
369369bool UnixNativeCodeManager::IsUnwindable (PTR_VOID pvAddress)
370370{
371+ MethodInfo * pMethodInfo = NULL ;
372+
373+ #if defined(TARGET_ARM64)
374+ MethodInfo methodInfo;
375+ FindMethodInfo (pvAddress, &methodInfo);
376+ pMethodInfo = &methodInfo;
377+ #endif
378+
371379 // VirtualUnwind can't unwind epilogues.
372- return TrailingEpilogueInstructionsCount (pvAddress) == 0 ;
380+ return TrailingEpilogueInstructionsCount (pMethodInfo, pvAddress) == 0 ;
373381}
374382
375383// when stopped in an epilogue, returns the count of remaining stack-consuming instructions
376384// otherwise returns
377385// 0 - not in epilogue,
378386// -1 - unknown.
379- int UnixNativeCodeManager::TrailingEpilogueInstructionsCount (PTR_VOID pvAddress)
387+ int UnixNativeCodeManager::TrailingEpilogueInstructionsCount (MethodInfo * pMethodInfo, PTR_VOID pvAddress)
380388{
381389#ifdef TARGET_AMD64
382390
@@ -598,9 +606,8 @@ int UnixNativeCodeManager::TrailingEpilogueInstructionsCount(PTR_VOID pvAddress)
598606#define BEGS_BITS 0x14000000
599607#define BEGS_MASK 0x1C000000
600608
601- MethodInfo pMethodInfo;
602- FindMethodInfo (pvAddress, &pMethodInfo);
603- UnixNativeMethodInfo* pNativeMethodInfo = (UnixNativeMethodInfo*)&pMethodInfo;
609+ UnixNativeMethodInfo * pNativeMethodInfo = (UnixNativeMethodInfo *)pMethodInfo;
610+ ASSERT (pNativeMethodInfo != NULL );
604611
605612 uint32_t * start = (uint32_t *)pNativeMethodInfo->pMethodStartAddress ;
606613
@@ -699,7 +706,7 @@ bool UnixNativeCodeManager::GetReturnAddressHijackInfo(MethodInfo * pMethodIn
699706 GcInfoDecoder decoder (GCInfoToken (p), flags);
700707 *pRetValueKind = GetGcRefKind (decoder.GetReturnKind ());
701708
702- int epilogueInstructions = TrailingEpilogueInstructionsCount ((PTR_VOID)pRegisterSet->IP );
709+ int epilogueInstructions = TrailingEpilogueInstructionsCount (pMethodInfo, (PTR_VOID)pRegisterSet->IP );
703710 if (epilogueInstructions < 0 )
704711 {
705712 // can't figure, possibly a breakpoint instruction
0 commit comments