From 0e2f5be14006c343c11e2b42886f8dbfe18b27d2 Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Thu, 12 Jul 2012 14:19:27 +0200 Subject: FFI: Show address pointed to for tostring(ref), too. --- src/lib_ffi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib_ffi.c b/src/lib_ffi.c index 931164b7..c74b497a 100644 --- a/src/lib_ffi.c +++ b/src/lib_ffi.c @@ -284,7 +284,10 @@ LJLIB_CF(ffi_meta___tostring) } else { CTState *cts = ctype_cts(L); CType *ct = ctype_raw(cts, id); - if (ctype_isref(ct->info)) ct = ctype_rawchild(cts, ct); + if (ctype_isref(ct->info)) { + p = *(void **)p; + ct = ctype_rawchild(cts, ct); + } if (ctype_iscomplex(ct->info)) { setstrV(L, L->top-1, lj_ctype_repr_complex(L, cdataptr(cd), ct->size)); goto checkgc; -- cgit v1.2.3-55-g6feb