diff --git a/src/vm_arm.dasc b/src/vm_arm.dasc index 9db3b827..8f723f21 100644 --- a/src/vm_arm.dasc +++ b/src/vm_arm.dasc @@ -543,9 +543,8 @@ static void build_subroutines(BuildCtx *ctx) |1: | beq ->cont_ffi_callback // cont = 1: return from FFI callback. | // cont = 0: tailcall from C function. - | ldr CARG3, [BASE, FRAME_FUNC] - | sub CARG4, CARG4, #16 - | sub RC, CARG4, BASE + | sub CARG4, CARG4, #16 + | sub RC, CARG4, BASE | b ->vm_call_tail |.endif | @@ -3749,7 +3748,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) case BC_TSETR: | decode_RB8 RB, INS | decode_RC8 RC, INS - | // RA = dst*8, RB = table*8, RC = key*8 + | // RA = src*8, RB = table*8, RC = key*8 | ldr TAB:CARG2, [BASE, RB] | ldr CARG3, [BASE, RC] | ldrb INS, TAB:CARG2->marked diff --git a/src/vm_x86.dasc b/src/vm_x86.dasc index 7b5abdd5..777985a4 100644 --- a/src/vm_x86.dasc +++ b/src/vm_x86.dasc @@ -4649,8 +4649,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | jnz <4 | movzx RA, PC_RA | not RAa - | lea RA, [BASE+RA*8] - | mov LFUNC:KBASE, [RA-8] // Need to prepare KBASE. + | mov LFUNC:KBASE, [BASE+RA*8-8] // Need to prepare KBASE. | mov KBASE, LFUNC:KBASE->pc | mov KBASE, [KBASE+PC2PROTO(k)] | jmp <4