diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-11-10 12:46:05 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-11-10 12:46:05 -0200 |
commit | ad20689febfe15e20c9bce6bb74459f169499524 (patch) | |
tree | 35ea80b8a81e86e375b8cc57444919dbcc7f8137 /ltm.c | |
parent | e32079015495f01e470b285a9a1f09552ab5c615 (diff) | |
download | lua-ad20689febfe15e20c9bce6bb74459f169499524.tar.gz lua-ad20689febfe15e20c9bce6bb74459f169499524.tar.bz2 lua-ad20689febfe15e20c9bce6bb74459f169499524.zip |
better error message for bitwise operators (they are not arithmetic...)
Diffstat (limited to '')
-rw-r--r-- | ltm.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltm.c,v 2.29 2014/07/18 13:36:14 roberto Exp roberto $ | 2 | ** $Id: ltm.c,v 2.30 2014/11/02 19:19:04 roberto Exp roberto $ |
3 | ** Tag methods | 3 | ** Tag methods |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -122,10 +122,12 @@ void luaT_trybinTM (lua_State *L, const TValue *p1, const TValue *p2, | |||
122 | lua_Number dummy; | 122 | lua_Number dummy; |
123 | if (tonumber(p1, &dummy) && tonumber(p2, &dummy)) | 123 | if (tonumber(p1, &dummy) && tonumber(p2, &dummy)) |
124 | luaG_tointerror(L, p1, p2); | 124 | luaG_tointerror(L, p1, p2); |
125 | else if (event != TM_IDIV) | ||
126 | luaG_opinterror(L, p1, p2, "perform bitwise operation on"); | ||
125 | /* else go through */ | 127 | /* else go through */ |
126 | } | 128 | } |
127 | default: | 129 | default: |
128 | luaG_aritherror(L, p1, p2); | 130 | luaG_opinterror(L, p1, p2, "perform arithmetic on"); |
129 | } | 131 | } |
130 | } | 132 | } |
131 | } | 133 | } |