]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
FFI: Show address pointed to for tostring(ref), too.
authorMike Pall <mike>
Thu, 12 Jul 2012 12:19:27 +0000 (14:19 +0200)
committerMike Pall <mike>
Thu, 12 Jul 2012 12:19:27 +0000 (14:19 +0200)
src/lib_ffi.c

index 931164b7e8fc9eac1cbebfd17a1cd0c152cda32b..c74b497a66057bf8f2dcf813497878b0d1fe275d 100644 (file)
@@ -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;