ntdll: Unwind to the LR register if no unwind info is available.

Try to keep the behaviour from ea9f47a767 of erroring out if
unwinding ends up out of bounds (with pc==lr, where setting pc
to lr doesn't progress the unwind), but support unwinding from
functions without unwind info.

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Martin Storsjo 2020-10-05 12:16:39 +03:00 committed by Alexandre Julliard
parent bd27af974a
commit df794f3425
1 changed files with 10 additions and 2 deletions

View File

@ -197,8 +197,16 @@ static NTSTATUS virtual_unwind( ULONG type, DISPATCHER_CONTEXT *dispatch, CONTEX
}
else
{
WARN( "exception data not found in %s\n", debugstr_w(module->BaseDllName.Buffer) );
return STATUS_INVALID_DISPOSITION;
status = context->Pc != context->u.s.Lr ?
STATUS_SUCCESS : STATUS_INVALID_DISPOSITION;
WARN( "exception data not found in %s for %p, LR %p, status %x\n",
debugstr_w(module->BaseDllName.Buffer), (void*) context->Pc,
(void*) context->u.s.Lr, status );
dispatch->EstablisherFrame = context->Sp;
dispatch->LanguageHandler = NULL;
context->Pc = context->u.s.Lr;
context->ContextFlags |= CONTEXT_UNWOUND_TO_CALL;
return status;
}
dispatch->EstablisherFrame = context->u.s.Fp;