Explorar o código

FFI: Show address pointed to for tostring(ref), too.

Mike Pall %!s(int64=13) %!d(string=hai) anos
pai
achega
0e2f5be140
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      src/lib_ffi.c

+ 4 - 1
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;