diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-07-30 11:00:14 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-07-30 11:00:14 -0300 |
commit | 34ac039fb84e3c12fb8c96c9c99c34224c09872b (patch) | |
tree | a859f6338c6c851088a67b129765de662ed6f223 /ldebug.c | |
parent | 1aa526263405fb4906eafab3011b13de4e5daf73 (diff) | |
download | lua-34ac039fb84e3c12fb8c96c9c99c34224c09872b.tar.gz lua-34ac039fb84e3c12fb8c96c9c99c34224c09872b.tar.bz2 lua-34ac039fb84e3c12fb8c96c9c99c34224c09872b.zip |
new macro 'cvt2str' to better control whether numbers are convertible
to strings
Diffstat (limited to 'ldebug.c')
-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.98 2014/07/15 21:26:50 roberto Exp roberto $ | 2 | ** $Id: ldebug.c,v 2.99 2014/07/17 12:30:53 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 | */ |
@@ -526,8 +526,7 @@ l_noret luaG_typeerror (lua_State *L, const TValue *o, const char *op) { | |||
526 | 526 | ||
527 | 527 | ||
528 | l_noret luaG_concaterror (lua_State *L, const TValue *p1, const TValue *p2) { | 528 | l_noret luaG_concaterror (lua_State *L, const TValue *p1, const TValue *p2) { |
529 | if (ttisstring(p1) || ttisnumber(p1)) p1 = p2; | 529 | if (ttisstring(p1) || cvt2str(p1)) p1 = p2; |
530 | lua_assert(!ttisstring(p1) && !ttisnumber(p1)); | ||
531 | luaG_typeerror(L, p1, "concatenate"); | 530 | luaG_typeerror(L, p1, "concatenate"); |
532 | } | 531 | } |
533 | 532 | ||