Browse Source

FFI: Fix cdata equality comparison against other Lua types.

Mike Pall 11 years ago
parent
commit
cc5075e845
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/lj_carith.c

+ 1 - 1
src/lj_carith.c

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