]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
FFI: Fix handling of enum arguments to C calls.
authorMike Pall <mike>
Mon, 7 Feb 2011 15:41:51 +0000 (16:41 +0100)
committerMike Pall <mike>
Mon, 7 Feb 2011 15:41:51 +0000 (16:41 +0100)
src/lj_crecord.c

index b7b3855fc2662651c4bed6d008f6a6581362a052..8473ee454ca470125cafdddb7a91a201b936c16b 100644 (file)
@@ -687,8 +687,8 @@ static TRef crec_call_args(jit_State *J, RecordFFData *rd,
     if (!ctype_isfield(ct->info))
       lj_trace_err(J, LJ_TRERR_NYICALL);
     d = ctype_rawchild(cts, ct);
-    if (ctype_isenum(d->info)) d = ctype_child(cts, d);
-    if (!(ctype_isnum(d->info) || ctype_isptr(d->info)))
+    if (!(ctype_isnum(d->info) || ctype_isptr(d->info) ||
+         ctype_isenum(d->info)))
       lj_trace_err(J, LJ_TRERR_NYICALL);
     args[n] = crec_ct_tv(J, d, 0, J->base[n+1], &rd->argv[n+1]);
   }