diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-07-07 13:34:32 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-07-07 13:34:32 -0300 |
commit | 4dff277255e3785b76b6b52fe2a98592e6cbc834 (patch) | |
tree | e3607d2aab29b6e0dbd46ac1acc81e9c6bf08dd7 /ldebug.c | |
parent | 07db10813cb044252c18973688f63b5eac6a90a6 (diff) | |
download | lua-4dff277255e3785b76b6b52fe2a98592e6cbc834.tar.gz lua-4dff277255e3785b76b6b52fe2a98592e6cbc834.tar.bz2 lua-4dff277255e3785b76b6b52fe2a98592e6cbc834.zip |
coercion string->number in arithmetic operations moved to string
library
Diffstat (limited to '')
-rw-r--r-- | ldebug.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldebug.c,v 2.127 2017/06/27 11:35:31 roberto Exp roberto $ | 2 | ** $Id: ldebug.c,v 2.128 2017/06/29 15:06:44 roberto Exp roberto $ |
3 | ** Debug Interface | 3 | ** Debug Interface |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -679,8 +679,7 @@ l_noret luaG_concaterror (lua_State *L, const TValue *p1, const TValue *p2) { | |||
679 | 679 | ||
680 | l_noret luaG_opinterror (lua_State *L, const TValue *p1, | 680 | l_noret luaG_opinterror (lua_State *L, const TValue *p1, |
681 | const TValue *p2, const char *msg) { | 681 | const TValue *p2, const char *msg) { |
682 | lua_Number temp; | 682 | if (!ttisnumber(p1)) /* first operand is wrong? */ |
683 | if (!tonumber(p1, &temp)) /* first operand is wrong? */ | ||
684 | p2 = p1; /* now second is wrong */ | 683 | p2 = p1; /* now second is wrong */ |
685 | luaG_typeerror(L, p2, msg); | 684 | luaG_typeerror(L, p2, msg); |
686 | } | 685 | } |