diff options
Diffstat (limited to 'src/lib_ffi.c')
-rw-r--r-- | src/lib_ffi.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib_ffi.c b/src/lib_ffi.c index c74b497a..5cb9086e 100644 --- a/src/lib_ffi.c +++ b/src/lib_ffi.c | |||
@@ -297,6 +297,9 @@ LJLIB_CF(ffi_meta___tostring) | |||
297 | goto checkgc; | 297 | goto checkgc; |
298 | } else if (ctype_isfunc(ct->info)) { | 298 | } else if (ctype_isfunc(ct->info)) { |
299 | p = *(void **)p; | 299 | p = *(void **)p; |
300 | } else if (ctype_isenum(ct->info)) { | ||
301 | msg = "cdata<%s>: %d"; | ||
302 | p = (void *)(uintptr_t)*(uint32_t **)p; | ||
300 | } else { | 303 | } else { |
301 | if (ctype_isptr(ct->info)) { | 304 | if (ctype_isptr(ct->info)) { |
302 | p = cdata_getptr(p, ct->size); | 305 | p = cdata_getptr(p, ct->size); |
@@ -348,7 +351,6 @@ LJLIB_CF(ffi_clib___index) LJLIB_REC(clib_index 1) | |||
348 | CTypeID sid = ctype_cid(s->info); | 351 | CTypeID sid = ctype_cid(s->info); |
349 | void *sp = *(void **)cdataptr(cd); | 352 | void *sp = *(void **)cdataptr(cd); |
350 | CType *ct = ctype_raw(cts, sid); | 353 | CType *ct = ctype_raw(cts, sid); |
351 | if (ctype_isenum(ct->info)) ct = ctype_child(cts, ct); | ||
352 | if (lj_cconv_tv_ct(cts, ct, sid, L->top-1, sp)) | 354 | if (lj_cconv_tv_ct(cts, ct, sid, L->top-1, sp)) |
353 | lj_gc_check(L); | 355 | lj_gc_check(L); |
354 | return 1; | 356 | return 1; |