Explorar o código

FFI: Fix cdata equality comparison against other Lua types.

Mike Pall %!s(int64=11) %!d(string=hai) anos
pai
achega
cc5075e845
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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 {
       ca->ct[i] = NULL;
-      ca->p[i] = NULL;
+      ca->p[i] = (void *)(intptr_t)1;  /* To make it unequal. */
       ok = 0;
     }
   }