diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2013-05-06 14:21:59 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2013-05-06 14:21:59 -0300 |
commit | f2043b7a589448990199f246a362c3df648157c7 (patch) | |
tree | f5e27b9ea2dfbf8791c5cef072f2643daed5a706 /ltm.c | |
parent | 2b1c2c61b025aa06446367965316b3878578a768 (diff) | |
download | lua-f2043b7a589448990199f246a362c3df648157c7.tar.gz lua-f2043b7a589448990199f246a362c3df648157c7.tar.bz2 lua-f2043b7a589448990199f246a362c3df648157c7.zip |
correct error message for conversion errors from float to int
Diffstat (limited to 'ltm.c')
-rw-r--r-- | ltm.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltm.c,v 2.18 2013/04/26 13:07:53 roberto Exp roberto $ | 2 | ** $Id: ltm.c,v 2.19 2013/04/29 16:56:50 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 | */ |
@@ -112,6 +112,8 @@ void luaT_trybinTM (lua_State *L, const TValue *p1, const TValue *p2, | |||
112 | if (!luaT_callbinTM(L, p1, p2, res, event)) { | 112 | if (!luaT_callbinTM(L, p1, p2, res, event)) { |
113 | if (event == TM_CONCAT) | 113 | if (event == TM_CONCAT) |
114 | luaG_concaterror(L, p1, p2); | 114 | luaG_concaterror(L, p1, p2); |
115 | else if (event == TM_IDIV && ttisnumber(p1) && ttisnumber(p2)) | ||
116 | luaG_tointerror(L, p1, p2); | ||
115 | else | 117 | else |
116 | luaG_aritherror(L, p1, p2); | 118 | luaG_aritherror(L, p1, p2); |
117 | } | 119 | } |