diff options
Diffstat (limited to 'src/lib_ffi.c')
-rw-r--r-- | src/lib_ffi.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib_ffi.c b/src/lib_ffi.c index 582e9bf7..82942e44 100644 --- a/src/lib_ffi.c +++ b/src/lib_ffi.c | |||
@@ -325,7 +325,7 @@ static TValue *ffi_clib_index(lua_State *L) | |||
325 | return lj_clib_index(L, cl, strV(o+1)); | 325 | return lj_clib_index(L, cl, strV(o+1)); |
326 | } | 326 | } |
327 | 327 | ||
328 | LJLIB_CF(ffi_clib___index) LJLIB_REC(clib_index) | 328 | LJLIB_CF(ffi_clib___index) LJLIB_REC(clib_index 1) |
329 | { | 329 | { |
330 | TValue *tv = ffi_clib_index(L); | 330 | TValue *tv = ffi_clib_index(L); |
331 | if (tviscdata(tv)) { | 331 | if (tviscdata(tv)) { |
@@ -335,7 +335,9 @@ LJLIB_CF(ffi_clib___index) LJLIB_REC(clib_index) | |||
335 | if (ctype_isextern(s->info)) { | 335 | if (ctype_isextern(s->info)) { |
336 | CTypeID sid = ctype_cid(s->info); | 336 | CTypeID sid = ctype_cid(s->info); |
337 | void *sp = *(void **)cdataptr(cd); | 337 | void *sp = *(void **)cdataptr(cd); |
338 | if (lj_cconv_tv_ct(cts, ctype_raw(cts, sid), sid, L->top-1, sp)) | 338 | CType *ct = ctype_raw(cts, sid); |
339 | if (ctype_isenum(ct->info)) ct = ctype_child(cts, ct); | ||
340 | if (lj_cconv_tv_ct(cts, ct, sid, L->top-1, sp)) | ||
339 | lj_gc_check(L); | 341 | lj_gc_check(L); |
340 | return 1; | 342 | return 1; |
341 | } | 343 | } |
@@ -344,7 +346,7 @@ LJLIB_CF(ffi_clib___index) LJLIB_REC(clib_index) | |||
344 | return 1; | 346 | return 1; |
345 | } | 347 | } |
346 | 348 | ||
347 | LJLIB_CF(ffi_clib___newindex) | 349 | LJLIB_CF(ffi_clib___newindex) LJLIB_REC(clib_index 0) |
348 | { | 350 | { |
349 | TValue *tv = ffi_clib_index(L); | 351 | TValue *tv = ffi_clib_index(L); |
350 | TValue *o = L->base+2; | 352 | TValue *o = L->base+2; |