diff options
author | Mike Pall <mike> | 2014-04-08 12:10:51 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2014-04-08 12:10:51 +0200 |
commit | 4ed3ee1f046618c5251baae3013f125b4cc7ca9c (patch) | |
tree | 49db7722bac6e6be8db60b3bc3e2791b9047512f /src/lj_carith.c | |
parent | 111b2e8711366b40161b4530f5f0a4fd08dc3420 (diff) | |
download | luajit-4ed3ee1f046618c5251baae3013f125b4cc7ca9c.tar.gz luajit-4ed3ee1f046618c5251baae3013f125b4cc7ca9c.tar.bz2 luajit-4ed3ee1f046618c5251baae3013f125b4cc7ca9c.zip |
FFI: Fix cdata equality comparison against strings.
Diffstat (limited to 'src/lj_carith.c')
-rw-r--r-- | src/lj_carith.c | 4 |
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) | |||
62 | TValue *o2 = i == 0 ? o+1 : o-1; | 62 | TValue *o2 = i == 0 ? o+1 : o-1; |
63 | CType *ct = ctype_raw(cts, cdataV(o2)->ctypeid); | 63 | CType *ct = ctype_raw(cts, cdataV(o2)->ctypeid); |
64 | ca->ct[i] = NULL; | 64 | ca->ct[i] = NULL; |
65 | ca->p[i] = NULL; | 65 | ca->p[i] = (uint8_t *)strVdata(o); |
66 | ok = 0; | 66 | ok = 0; |
67 | if (ctype_isenum(ct->info)) { | 67 | if (ctype_isenum(ct->info)) { |
68 | CTSize ofs; | 68 | CTSize ofs; |
@@ -73,7 +73,7 @@ static int carith_checkarg(lua_State *L, CTState *cts, CDArith *ca) | |||
73 | ok = 1; | 73 | ok = 1; |
74 | } else { | 74 | } else { |
75 | ca->ct[1-i] = ct; /* Use enum to improve error message. */ | 75 | ca->ct[1-i] = ct; /* Use enum to improve error message. */ |
76 | ca->p[1-i] = (void *)(intptr_t)1; /* To make it unequal. */ | 76 | ca->p[1-i] = NULL; |
77 | break; | 77 | break; |
78 | } | 78 | } |
79 | } | 79 | } |