diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-04-11 17:17:39 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-04-11 17:17:39 -0300 |
| commit | 218f3584618ec5700c1e2a39f6f5734c3480b59b (patch) | |
| tree | 4e61e85a28a8a99f16f06be7ee1d24fe00ce7d70 | |
| parent | bf06e22b6a8415adc6970adfea84d3b236425c90 (diff) | |
| download | lua-218f3584618ec5700c1e2a39f6f5734c3480b59b.tar.gz lua-218f3584618ec5700c1e2a39f6f5734c3480b59b.tar.bz2 lua-218f3584618ec5700c1e2a39f6f5734c3480b59b.zip | |
errors like 1e100 << "2" were giving wrong messages
| -rw-r--r-- | ltm.c | 8 |
1 files changed, 5 insertions, 3 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltm.c,v 2.24 2013/12/18 14:12:03 roberto Exp roberto $ | 2 | ** $Id: ltm.c,v 2.25 2013/12/30 20:47:58 roberto Exp $ |
| 3 | ** Tag methods | 3 | ** Tag methods |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -116,10 +116,12 @@ void luaT_trybinTM (lua_State *L, const TValue *p1, const TValue *p2, | |||
| 116 | case TM_CONCAT: | 116 | case TM_CONCAT: |
| 117 | luaG_concaterror(L, p1, p2); | 117 | luaG_concaterror(L, p1, p2); |
| 118 | case TM_IDIV: case TM_BAND: case TM_BOR: case TM_BXOR: | 118 | case TM_IDIV: case TM_BAND: case TM_BOR: case TM_BXOR: |
| 119 | case TM_SHL: case TM_SHR: case TM_BNOT: | 119 | case TM_SHL: case TM_SHR: case TM_BNOT: { |
| 120 | if (ttisnumber(p1) && ttisnumber(p2)) | 120 | lua_Number dummy; |
| 121 | if (tonumber(p1, &dummy) && tonumber(p2, &dummy)) | ||
| 121 | luaG_tointerror(L, p1, p2); | 122 | luaG_tointerror(L, p1, p2); |
| 122 | /* else go through */ | 123 | /* else go through */ |
| 124 | } | ||
| 123 | default: | 125 | default: |
| 124 | luaG_aritherror(L, p1, p2); | 126 | luaG_aritherror(L, p1, p2); |
| 125 | } | 127 | } |
