diff options
author | Mike Pall <mike> | 2012-05-23 22:19:05 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2012-05-23 22:20:27 +0200 |
commit | 3a43ea50843e4f6db73b8edf637dfd209ffbe2ab (patch) | |
tree | d939ba39e95c0463fd12bad5963a0b50564a47a5 /src/lj_carith.c | |
parent | f3197046b801b20e28a2b9acc6fb0ee4f51f9f2f (diff) | |
download | luajit-3a43ea50843e4f6db73b8edf637dfd209ffbe2ab.tar.gz luajit-3a43ea50843e4f6db73b8edf637dfd209ffbe2ab.tar.bz2 luajit-3a43ea50843e4f6db73b8edf637dfd209ffbe2ab.zip |
FFI: Equality comparisons never raise an error.
Diffstat (limited to 'src/lj_carith.c')
-rw-r--r-- | src/lj_carith.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lj_carith.c b/src/lj_carith.c index 56708bf6..583a3876 100644 --- a/src/lj_carith.c +++ b/src/lj_carith.c | |||
@@ -205,6 +205,10 @@ static int lj_carith_meta(lua_State *L, CTState *cts, CDArith *ca, MMS mm) | |||
205 | if (!tv) { | 205 | if (!tv) { |
206 | const char *repr[2]; | 206 | const char *repr[2]; |
207 | int i; | 207 | int i; |
208 | if (mm == MM_eq) { /* Equality checks never raise an error. */ | ||
209 | setboolV(L->top-1, 0); | ||
210 | return 1; | ||
211 | } | ||
208 | for (i = 0; i < 2; i++) { | 212 | for (i = 0; i < 2; i++) { |
209 | if (ca->ct[i]) | 213 | if (ca->ct[i]) |
210 | repr[i] = strdata(lj_ctype_repr(L, ctype_typeid(cts, ca->ct[i]), NULL)); | 214 | repr[i] = strdata(lj_ctype_repr(L, ctype_typeid(cts, ca->ct[i]), NULL)); |