]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
FFI: Fix cdata equality comparison against other Lua types.
authorMike Pall <mike>
Tue, 8 Apr 2014 14:53:41 +0000 (16:53 +0200)
committerMike Pall <mike>
Tue, 8 Apr 2014 14:53:41 +0000 (16:53 +0200)
src/lj_carith.c

index 36d7abb160516e17a4f1b10269dc5678dd366c14..9a451b246f5e8bb1438c1e4acae2f0f1647c1c7f 100644 (file)
@@ -79,7 +79,7 @@ static int carith_checkarg(lua_State *L, CTState *cts, CDArith *ca)
       }
     } else {
       ca->ct[i] = NULL;
-      ca->p[i] = NULL;
+      ca->p[i] = (void *)(intptr_t)1;  /* To make it unequal. */
       ok = 0;
     }
   }