diff options
author | Mike Pall <mike> | 2016-07-17 16:01:10 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2016-07-17 16:01:10 +0200 |
commit | b74ddaf174ce087cf9d6087766afcb7180656661 (patch) | |
tree | e7591a8a3bd9994e8550dccab0c9b2ddd5a3493d /src | |
parent | 1914de71c7dc10c502ecf033c63665eb6d3e6433 (diff) | |
download | luajit-b74ddaf174ce087cf9d6087766afcb7180656661.tar.gz luajit-b74ddaf174ce087cf9d6087766afcb7180656661.tar.bz2 luajit-b74ddaf174ce087cf9d6087766afcb7180656661.zip |
Fix for cdata vs. non-cdata arithmetics/comparisons.
Thanks to Vyacheslav Egorov.
Diffstat (limited to 'src')
-rw-r--r-- | src/lj_crecord.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lj_crecord.c b/src/lj_crecord.c index a53a2ce9..0565e5fd 100644 --- a/src/lj_crecord.c +++ b/src/lj_crecord.c | |||
@@ -1205,7 +1205,7 @@ void LJ_FASTCALL recff_cdata_call(jit_State *J, RecordFFData *rd) | |||
1205 | 1205 | ||
1206 | static TRef crec_arith_int64(jit_State *J, TRef *sp, CType **s, MMS mm) | 1206 | static TRef crec_arith_int64(jit_State *J, TRef *sp, CType **s, MMS mm) |
1207 | { | 1207 | { |
1208 | if (ctype_isnum(s[0]->info) && ctype_isnum(s[1]->info)) { | 1208 | if (sp[0] && sp[1] && ctype_isnum(s[0]->info) && ctype_isnum(s[1]->info)) { |
1209 | IRType dt; | 1209 | IRType dt; |
1210 | CTypeID id; | 1210 | CTypeID id; |
1211 | TRef tr; | 1211 | TRef tr; |
@@ -1263,6 +1263,7 @@ static TRef crec_arith_ptr(jit_State *J, TRef *sp, CType **s, MMS mm) | |||
1263 | { | 1263 | { |
1264 | CTState *cts = ctype_ctsG(J2G(J)); | 1264 | CTState *cts = ctype_ctsG(J2G(J)); |
1265 | CType *ctp = s[0]; | 1265 | CType *ctp = s[0]; |
1266 | if (!(sp[0] && sp[1])) return 0; | ||
1266 | if (ctype_isptr(ctp->info) || ctype_isrefarray(ctp->info)) { | 1267 | if (ctype_isptr(ctp->info) || ctype_isrefarray(ctp->info)) { |
1267 | if ((mm == MM_sub || mm == MM_eq || mm == MM_lt || mm == MM_le) && | 1268 | if ((mm == MM_sub || mm == MM_eq || mm == MM_lt || mm == MM_le) && |
1268 | (ctype_isptr(s[1]->info) || ctype_isrefarray(s[1]->info))) { | 1269 | (ctype_isptr(s[1]->info) || ctype_isrefarray(s[1]->info))) { |