From 34ac039fb84e3c12fb8c96c9c99c34224c09872b Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 30 Jul 2014 11:00:14 -0300 Subject: new macro 'cvt2str' to better control whether numbers are convertible to strings --- ldebug.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'ldebug.c') diff --git a/ldebug.c b/ldebug.c index f7b2866e..e31c0607 100644 --- a/ldebug.c +++ b/ldebug.c @@ -1,5 +1,5 @@ /* -** $Id: ldebug.c,v 2.98 2014/07/15 21:26:50 roberto Exp roberto $ +** $Id: ldebug.c,v 2.99 2014/07/17 12:30:53 roberto Exp roberto $ ** Debug Interface ** See Copyright Notice in lua.h */ @@ -526,8 +526,7 @@ l_noret luaG_typeerror (lua_State *L, const TValue *o, const char *op) { l_noret luaG_concaterror (lua_State *L, const TValue *p1, const TValue *p2) { - if (ttisstring(p1) || ttisnumber(p1)) p1 = p2; - lua_assert(!ttisstring(p1) && !ttisnumber(p1)); + if (ttisstring(p1) || cvt2str(p1)) p1 = p2; luaG_typeerror(L, p1, "concatenate"); } -- cgit v1.2.3-55-g6feb