mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[RTL/x64] Properly handle UNW_FLAG_CHAININFO
This commit is contained in:
parent
6a9a739185
commit
d24700f82e
1 changed files with 12 additions and 10 deletions
|
@ -523,16 +523,6 @@ RtlVirtualUnwind(
|
|||
/* Get a pointer to the unwind info */
|
||||
UnwindInfo = RVA(ImageBase, FunctionEntry->UnwindData);
|
||||
|
||||
/* Check for chained info */
|
||||
if (UnwindInfo->Flags & UNW_FLAG_CHAININFO)
|
||||
{
|
||||
UNIMPLEMENTED_DBGBREAK();
|
||||
|
||||
/* See https://docs.microsoft.com/en-us/cpp/build/chained-unwind-info-structures */
|
||||
FunctionEntry = (PRUNTIME_FUNCTION)&(UnwindInfo->UnwindCode[(UnwindInfo->CountOfCodes + 1) & ~1]);
|
||||
UnwindInfo = RVA(ImageBase, FunctionEntry->UnwindData);
|
||||
}
|
||||
|
||||
/* The language specific handler data follows the unwind info */
|
||||
LanguageHandler = ALIGN_UP_POINTER_BY(&UnwindInfo->UnwindCode[UnwindInfo->CountOfCodes], sizeof(ULONG));
|
||||
*HandlerData = (LanguageHandler + 1);
|
||||
|
@ -560,6 +550,8 @@ RtlVirtualUnwind(
|
|||
i += UnwindOpSlots(UnwindInfo->UnwindCode[i]);
|
||||
}
|
||||
|
||||
RepeatChainedInfo:
|
||||
|
||||
/* Process the remaining unwind ops */
|
||||
while (i < UnwindInfo->CountOfCodes)
|
||||
{
|
||||
|
@ -650,6 +642,16 @@ RtlVirtualUnwind(
|
|||
}
|
||||
}
|
||||
|
||||
/* Check for chained info */
|
||||
if (UnwindInfo->Flags & UNW_FLAG_CHAININFO)
|
||||
{
|
||||
/* See https://docs.microsoft.com/en-us/cpp/build/exception-handling-x64?view=msvc-160#chained-unwind-info-structures */
|
||||
FunctionEntry = (PRUNTIME_FUNCTION)&(UnwindInfo->UnwindCode[(UnwindInfo->CountOfCodes + 1) & ~1]);
|
||||
UnwindInfo = RVA(ImageBase, FunctionEntry->UnwindData);
|
||||
i = 0;
|
||||
goto RepeatChainedInfo;
|
||||
}
|
||||
|
||||
/* Unwind is finished, pop new Rip from Stack */
|
||||
if (Context->Rsp != 0)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue