aboutsummaryrefslogtreecommitdiff
path: root/ltm.c
diff options
context:
space:
mode:
Diffstat (limited to 'ltm.c')
-rw-r--r--ltm.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ltm.c b/ltm.c
index 1aa25bf0..37b5cd3d 100644
--- a/ltm.c
+++ b/ltm.c
@@ -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 }