diff --git a/src/vm_x64.dasc b/src/vm_x64.dasc index 759e30ec0b..89f66654fa 100644 --- a/src/vm_x64.dasc +++ b/src/vm_x64.dasc @@ -492,6 +492,7 @@ static void build_subroutines(BuildCtx *ctx) |->vm_unwind_c_eh: // Landing pad for external unwinder. | mov L:RB, SAVE_L | mov GL:RB, L:RB->glref + | mov [GL:RB->cur_L], L:RB | mov dword GL:RB->vmstate, ~LJ_VMST_C | jmp ->vm_leave_unw | @@ -519,6 +520,7 @@ static void build_subroutines(BuildCtx *ctx) | mov [BASE-16], RA // Prepend false to error message. | mov [BASE-8], RB | mov RA, -16 // Results start at BASE+RA = BASE-16. + | mov [DISPATCH+DISPATCH_GL(cur_L)], L:RB | set_vmstate INTERP | jmp ->vm_returnc // Increments RD/MULTRES and returns. | diff --git a/src/vm_x86.dasc b/src/vm_x86.dasc index f108c0b567..ac4121b8d4 100644 --- a/src/vm_x86.dasc +++ b/src/vm_x86.dasc @@ -558,6 +558,7 @@ static void build_subroutines(BuildCtx *ctx) |->vm_unwind_c_eh: // Landing pad for external unwinder. | mov L:RB, SAVE_L | mov GL:RB, L:RB->glref + | mov dword GL:RB->cur_L, L:RB | mov dword GL:RB->vmstate, ~LJ_VMST_C | jmp ->vm_leave_unw | @@ -587,6 +588,7 @@ static void build_subroutines(BuildCtx *ctx) | add DISPATCH, GG_G2DISP | mov PC, [BASE-4] // Fetch PC of previous frame. | mov dword [BASE-4], LJ_TFALSE // Prepend false to error message. + | mov [DISPATCH+DISPATCH_GL(cur_L)], L:RB | set_vmstate INTERP | jmp ->vm_returnc // Increments RD/MULTRES and returns. |