diff options
author | Mike Pall <mike> | 2020-12-04 11:16:55 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2020-12-04 11:16:55 +0100 |
commit | d67ff15a5cf11dff46fa2288e0c074526548db2b (patch) | |
tree | d07cafec22a165d0488b5adc4eaf0fd49e6c7e76 /src | |
parent | 7aa3e313a363049bef4a75ad9c75b1dd2adfc3de (diff) | |
download | luajit-d67ff15a5cf11dff46fa2288e0c074526548db2b.tar.gz luajit-d67ff15a5cf11dff46fa2288e0c074526548db2b.tar.bz2 luajit-d67ff15a5cf11dff46fa2288e0c074526548db2b.zip |
x64: Fix __call metamethod return dispatch.
Reported by Igor Munkin.
Diffstat (limited to 'src')
-rw-r--r-- | src/vm_x86.dasc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vm_x86.dasc b/src/vm_x86.dasc index b23d046b..60359bd7 100644 --- a/src/vm_x86.dasc +++ b/src/vm_x86.dasc | |||
@@ -1246,7 +1246,11 @@ static void build_subroutines(BuildCtx *ctx) | |||
1246 | | mov LFUNC:RB, [RA-8] | 1246 | | mov LFUNC:RB, [RA-8] |
1247 | | add NARGS:RD, 1 | 1247 | | add NARGS:RD, 1 |
1248 | | // This is fragile. L->base must not move, KBASE must always be defined. | 1248 | | // 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 | ||
1249 | | cmp KBASE, BASE // Continue with CALLT if flag set. | 1252 | | cmp KBASE, BASE // Continue with CALLT if flag set. |
1253 | |.endif | ||
1250 | | je ->BC_CALLT_Z | 1254 | | je ->BC_CALLT_Z |
1251 | | mov BASE, RA | 1255 | | mov BASE, RA |
1252 | | ins_call // Otherwise call resolved metamethod. | 1256 | | ins_call // Otherwise call resolved metamethod. |