aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2007-05-29 15:59:59 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2007-05-29 15:59:59 -0300
commitfc8d077612a235b42d5defd48d6ba923ed85a17f (patch)
tree178e4b1b4f4df8aa547fed533403b934ae6b3807
parente64fcb9d9454d7640a0a171c9e625139c0c436c0 (diff)
downloadlua-fc8d077612a235b42d5defd48d6ba923ed85a17f.tar.gz
lua-fc8d077612a235b42d5defd48d6ba923ed85a17f.tar.bz2
lua-fc8d077612a235b42d5defd48d6ba923ed85a17f.zip
bug: wrong error message in some concatenations
-rw-r--r--bugs23
-rw-r--r--ldebug.c6
2 files changed, 25 insertions, 4 deletions
diff --git a/bugs b/bugs
index 2025aa63..45345a85 100644
--- a/bugs
+++ b/bugs
@@ -1417,7 +1417,7 @@ lcode.c:
1417 1417
1418Bug{ 1418Bug{
1419what = [[Count hook may be called without being set.]], 1419what = [[Count hook may be called without being set.]],
1420report = [[Mike Pall, on May 2007]], 1420report = [[Mike Pall, on 05/2007]],
1421since = [[?]], 1421since = [[?]],
1422example = [[ ]], 1422example = [[ ]],
1423patch = [[ 1423patch = [[
@@ -1449,6 +1449,27 @@ not in 'lua_State'.)
1449} 1449}
1450 1450
1451Bug{ 1451Bug{
1452what = [[wrong error message in some concatenations]],
1453report = [[Alex Davies, on 05/2007]],
1454since = [[5.1.2]],
1455example = [[a = nil; a = (1)..a]],
1456patch = [[
1457ldebug.c:
1458@@ -563,8 +563,8 @@
1459
1460
1461 void luaG_concaterror (lua_State *L, StkId p1, StkId p2) {
1462- if (ttisstring(p1)) p1 = p2;
1463- lua_assert(!ttisstring(p1));
1464+ if (ttisstring(p1) || ttisnumber(p1)) p1 = p2;
1465+ lua_assert(!ttisstring(p1) && !ttisnumber(p1));
1466 luaG_typeerror(L, p1, "concatenate");
1467 }
1468
1469]],
1470}
1471
1472Bug{
1452what = [[ ]], 1473what = [[ ]],
1453report = [[ , on ]], 1474report = [[ , on ]],
1454since = [[i ]], 1475since = [[i ]],
diff --git a/ldebug.c b/ldebug.c
index 240f5277..e76da28c 100644
--- a/ldebug.c
+++ b/ldebug.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldebug.c,v 2.35 2007/03/26 18:35:34 roberto Exp roberto $ 2** $Id: ldebug.c,v 2.36 2007/05/09 15:49:36 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*/
@@ -591,8 +591,8 @@ void luaG_typeerror (lua_State *L, const TValue *o, const char *op) {
591 591
592 592
593void luaG_concaterror (lua_State *L, StkId p1, StkId p2) { 593void luaG_concaterror (lua_State *L, StkId p1, StkId p2) {
594 if (ttisstring(p1)) p1 = p2; 594 if (ttisstring(p1) || ttisnumber(p1)) p1 = p2;
595 lua_assert(!ttisstring(p1)); 595 lua_assert(!ttisstring(p1) && !ttisnumber(p2));
596 luaG_typeerror(L, p1, "concatenate"); 596 luaG_typeerror(L, p1, "concatenate");
597} 597}
598 598