From 218f3584618ec5700c1e2a39f6f5734c3480b59b Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 11 Apr 2014 17:17:39 -0300 Subject: errors like 1e100 << "2" were giving wrong messages --- ltm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'ltm.c') diff --git a/ltm.c b/ltm.c index 1aa25bf0..37b5cd3d 100644 --- a/ltm.c +++ b/ltm.c @@ -1,5 +1,5 @@ /* -** $Id: ltm.c,v 2.24 2013/12/18 14:12:03 roberto Exp roberto $ +** $Id: ltm.c,v 2.25 2013/12/30 20:47:58 roberto Exp $ ** Tag methods ** See Copyright Notice in lua.h */ @@ -116,10 +116,12 @@ void luaT_trybinTM (lua_State *L, const TValue *p1, const TValue *p2, case TM_CONCAT: luaG_concaterror(L, p1, p2); case TM_IDIV: case TM_BAND: case TM_BOR: case TM_BXOR: - case TM_SHL: case TM_SHR: case TM_BNOT: - if (ttisnumber(p1) && ttisnumber(p2)) + case TM_SHL: case TM_SHR: case TM_BNOT: { + lua_Number dummy; + if (tonumber(p1, &dummy) && tonumber(p2, &dummy)) luaG_tointerror(L, p1, p2); /* else go through */ + } default: luaG_aritherror(L, p1, p2); } -- cgit v1.2.3-55-g6feb