diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2007-05-29 15:59:59 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2007-05-29 15:59:59 -0300 |
commit | fc8d077612a235b42d5defd48d6ba923ed85a17f (patch) | |
tree | 178e4b1b4f4df8aa547fed533403b934ae6b3807 | |
parent | e64fcb9d9454d7640a0a171c9e625139c0c436c0 (diff) | |
download | lua-fc8d077612a235b42d5defd48d6ba923ed85a17f.tar.gz lua-fc8d077612a235b42d5defd48d6ba923ed85a17f.tar.bz2 lua-fc8d077612a235b42d5defd48d6ba923ed85a17f.zip |
bug: wrong error message in some concatenations
-rw-r--r-- | bugs | 23 | ||||
-rw-r--r-- | ldebug.c | 6 |
2 files changed, 25 insertions, 4 deletions
@@ -1417,7 +1417,7 @@ lcode.c: | |||
1417 | 1417 | ||
1418 | Bug{ | 1418 | Bug{ |
1419 | what = [[Count hook may be called without being set.]], | 1419 | what = [[Count hook may be called without being set.]], |
1420 | report = [[Mike Pall, on May 2007]], | 1420 | report = [[Mike Pall, on 05/2007]], |
1421 | since = [[?]], | 1421 | since = [[?]], |
1422 | example = [[ ]], | 1422 | example = [[ ]], |
1423 | patch = [[ | 1423 | patch = [[ |
@@ -1449,6 +1449,27 @@ not in 'lua_State'.) | |||
1449 | } | 1449 | } |
1450 | 1450 | ||
1451 | Bug{ | 1451 | Bug{ |
1452 | what = [[wrong error message in some concatenations]], | ||
1453 | report = [[Alex Davies, on 05/2007]], | ||
1454 | since = [[5.1.2]], | ||
1455 | example = [[a = nil; a = (1)..a]], | ||
1456 | patch = [[ | ||
1457 | ldebug.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 | |||
1472 | Bug{ | ||
1452 | what = [[ ]], | 1473 | what = [[ ]], |
1453 | report = [[ , on ]], | 1474 | report = [[ , on ]], |
1454 | since = [[i ]], | 1475 | since = [[i ]], |
@@ -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 | ||
593 | void luaG_concaterror (lua_State *L, StkId p1, StkId p2) { | 593 | void 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 | ||