correct error message for conversion errors from float to int

This commit is contained in:
Roberto Ierusalimschy
2013-05-06 14:21:59 -03:00
parent 2b1c2c61b0
commit f2043b7a58
3 changed files with 26 additions and 12 deletions

4
ltm.c
View File

@@ -1,5 +1,5 @@
/*
** $Id: ltm.c,v 2.18 2013/04/26 13:07:53 roberto Exp roberto $
** $Id: ltm.c,v 2.19 2013/04/29 16:56:50 roberto Exp roberto $
** Tag methods
** See Copyright Notice in lua.h
*/
@@ -112,6 +112,8 @@ void luaT_trybinTM (lua_State *L, const TValue *p1, const TValue *p2,
if (!luaT_callbinTM(L, p1, p2, res, event)) {
if (event == TM_CONCAT)
luaG_concaterror(L, p1, p2);
else if (event == TM_IDIV && ttisnumber(p1) && ttisnumber(p2))
luaG_tointerror(L, p1, p2);
else
luaG_aritherror(L, p1, p2);
}