Skip to content

Commit d67ff15

Browse files
author
Mike Pall
committed
x64: Fix __call metamethod return dispatch.
Reported by Igor Munkin.
1 parent 7aa3e31 commit d67ff15

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/vm_x86.dasc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1246,7 +1246,11 @@ static void build_subroutines(BuildCtx *ctx)
12461246
| mov LFUNC:RB, [RA-8]
12471247
| add NARGS:RD, 1
12481248
| // This is fragile. L->base must not move, KBASE must always be defined.
1249+
|.if x64
1250+
| cmp KBASEa, rdx // Continue with CALLT if flag set.
1251+
|.else
12491252
| cmp KBASE, BASE // Continue with CALLT if flag set.
1253+
|.endif
12501254
| je ->BC_CALLT_Z
12511255
| mov BASE, RA
12521256
| ins_call // Otherwise call resolved metamethod.

0 commit comments

Comments
 (0)