diff options
author | Mike Pall <mike> | 2023-07-08 19:30:56 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2023-07-08 19:30:56 +0200 |
commit | 4c35a42d9cd3b8be98fa419c68e4724ccdf4f2cf (patch) | |
tree | 20e57bb6f5f97030e65d08bf1caebd72d84d7bec | |
parent | 9f452bbef5031afc506d8615f5e720c45acd6fdf (diff) | |
download | luajit-4c35a42d9cd3b8be98fa419c68e4724ccdf4f2cf.tar.gz luajit-4c35a42d9cd3b8be98fa419c68e4724ccdf4f2cf.tar.bz2 luajit-4c35a42d9cd3b8be98fa419c68e4724ccdf4f2cf.zip |
FFI: Fix ffi.metatype() for non-raw types.
Reported by 999pingGG. #1005
-rw-r--r-- | src/lib_ffi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib_ffi.c b/src/lib_ffi.c index 654e71a2..3978a83e 100644 --- a/src/lib_ffi.c +++ b/src/lib_ffi.c | |||
@@ -749,7 +749,7 @@ LJLIB_CF(ffi_metatype) | |||
749 | if (!(ctype_isstruct(ct->info) || ctype_iscomplex(ct->info) || | 749 | if (!(ctype_isstruct(ct->info) || ctype_iscomplex(ct->info) || |
750 | ctype_isvector(ct->info))) | 750 | ctype_isvector(ct->info))) |
751 | lj_err_arg(L, 1, LJ_ERR_FFI_INVTYPE); | 751 | lj_err_arg(L, 1, LJ_ERR_FFI_INVTYPE); |
752 | tv = lj_tab_setinth(L, t, -(int32_t)id); | 752 | tv = lj_tab_setinth(L, t, -(int32_t)ctype_typeid(cts, ct)); |
753 | if (!tvisnil(tv)) | 753 | if (!tvisnil(tv)) |
754 | lj_err_caller(L, LJ_ERR_PROTMT); | 754 | lj_err_caller(L, LJ_ERR_PROTMT); |
755 | settabV(L, tv, mt); | 755 | settabV(L, tv, mt); |