]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
FFI: Record calls to functions with void results.
authorMike Pall <mike>
Tue, 22 Feb 2011 23:28:49 +0000 (00:28 +0100)
committerMike Pall <mike>
Tue, 22 Feb 2011 23:28:49 +0000 (00:28 +0100)
src/lj_crecord.c

index 0120b3eb32ab587661c56b25b2218ede4ff6aeec..5e058a6fdbc9787d31ffc724c357b882a5e32186 100644 (file)
@@ -707,8 +707,14 @@ static int crec_call(jit_State *J, RecordFFData *rd, GCcdata *cd)
     CType *ctr = ctype_rawchild(cts, ct);
     IRType t = crec_ct2irt(ctr);
     TRef tr;
-    if (ctype_isenum(ctr->info)) ctr = ctype_child(cts, ctr);
-    if (!(ctype_isnum(ctr->info) || ctype_isptr(ctr->info)) ||
+    if (ctype_isvoid(ctr->info)) {
+      t = IRT_NIL;
+      rd->nres = 0;
+    } else if (ctype_isenum(ctr->info)) {
+      ctr = ctype_child(cts, ctr);
+    }
+    if (!(ctype_isnum(ctr->info) || ctype_isptr(ctr->info) ||
+         ctype_isvoid(ctr->info)) ||
        ctype_isbool(ctr->info) || (ct->info & CTF_VARARG) ||
 #if LJ_TARGET_X86
        ctype_cconv(ct->info) != CTCC_CDECL ||