mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 15:14:08 +00:00
FFI: Fix ffi.metatype() for non-raw types.
Reported by 999pingGG. #1005
This commit is contained in:
parent
9f452bbef5
commit
4c35a42d9c
@ -749,7 +749,7 @@ LJLIB_CF(ffi_metatype)
|
|||||||
if (!(ctype_isstruct(ct->info) || ctype_iscomplex(ct->info) ||
|
if (!(ctype_isstruct(ct->info) || ctype_iscomplex(ct->info) ||
|
||||||
ctype_isvector(ct->info)))
|
ctype_isvector(ct->info)))
|
||||||
lj_err_arg(L, 1, LJ_ERR_FFI_INVTYPE);
|
lj_err_arg(L, 1, LJ_ERR_FFI_INVTYPE);
|
||||||
tv = lj_tab_setinth(L, t, -(int32_t)id);
|
tv = lj_tab_setinth(L, t, -(int32_t)ctype_typeid(cts, ct));
|
||||||
if (!tvisnil(tv))
|
if (!tvisnil(tv))
|
||||||
lj_err_caller(L, LJ_ERR_PROTMT);
|
lj_err_caller(L, LJ_ERR_PROTMT);
|
||||||
settabV(L, tv, mt);
|
settabV(L, tv, mt);
|
||||||
|
Loading…
Reference in New Issue
Block a user