summaryrefslogtreecommitdiff
path: root/src/lj_carith.c
diff options
context:
space:
mode:
authorMike Pall <mike>2014-04-08 12:10:51 +0200
committerMike Pall <mike>2014-04-08 12:10:51 +0200
commit4ed3ee1f046618c5251baae3013f125b4cc7ca9c (patch)
tree49db7722bac6e6be8db60b3bc3e2791b9047512f /src/lj_carith.c
parent111b2e8711366b40161b4530f5f0a4fd08dc3420 (diff)
downloadluajit2-4ed3ee1f046618c5251baae3013f125b4cc7ca9c.tar.gz
FFI: Fix cdata equality comparison against strings.
Diffstat (limited to 'src/lj_carith.c')
-rw-r--r--src/lj_carith.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lj_carith.c b/src/lj_carith.c
index 92fe5597..36d7abb1 100644
--- a/src/lj_carith.c
+++ b/src/lj_carith.c
@@ -62,7 +62,7 @@ static int carith_checkarg(lua_State *L, CTState *cts, CDArith *ca)
TValue *o2 = i == 0 ? o+1 : o-1;
CType *ct = ctype_raw(cts, cdataV(o2)->ctypeid);
ca->ct[i] = NULL;
- ca->p[i] = NULL;
+ ca->p[i] = (uint8_t *)strVdata(o);
ok = 0;
if (ctype_isenum(ct->info)) {
CTSize ofs;
@@ -73,7 +73,7 @@ static int carith_checkarg(lua_State *L, CTState *cts, CDArith *ca)
ok = 1;
} else {
ca->ct[1-i] = ct; /* Use enum to improve error message. */
- ca->p[1-i] = (void *)(intptr_t)1; /* To make it unequal. */
+ ca->p[1-i] = NULL;
break;
}
}