From 7a1c139569874f371f567d060738a3f5704930a1 Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Fri, 15 Sep 2023 05:31:26 +0200 Subject: [PATCH] Windows: Pass scratch CONTEXT record to RtlUnwindEx. Thanks to Peter Cawley. #593 --- src/lj_err.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lj_err.c b/src/lj_err.c index 8ef51bf2..9677a1b0 100644 --- a/src/lj_err.c +++ b/src/lj_err.c @@ -285,8 +285,8 @@ LJ_FUNCA int lj_err_unwind_win(EXCEPTION_RECORD *rec, /* Don't catch access violations etc. */ return 1; /* ExceptionContinueSearch */ } -#if LJ_TARGET_X86 UNUSED(ctx); +#if LJ_TARGET_X86 UNUSED(dispatch); /* Call all handlers for all lower C frames (including ourselves) again ** with EH_UNWINDING set. Then call the specified function, passing cf @@ -304,7 +304,8 @@ LJ_FUNCA int lj_err_unwind_win(EXCEPTION_RECORD *rec, RtlUnwindEx(f, (void *)((cframe_unwind_ff(cf2) && errcode != LUA_YIELD) ? lj_vm_unwind_ff_eh : lj_vm_unwind_c_eh), - rec, (void *)(uintptr_t)errcode, ctx, dispatch->HistoryTable); + rec, (void *)(uintptr_t)errcode, dispatch->ContextRecord, + dispatch->HistoryTable); /* RtlUnwindEx should never return. */ #endif }