mirror of
https://github.com/lua/lua
synced 2024-11-22 21:01:26 +03:00
bug: wrong error message in some concatenations
This commit is contained in:
parent
e64fcb9d94
commit
fc8d077612
23
bugs
23
bugs
@ -1417,7 +1417,7 @@ lcode.c:
|
|||||||
|
|
||||||
Bug{
|
Bug{
|
||||||
what = [[Count hook may be called without being set.]],
|
what = [[Count hook may be called without being set.]],
|
||||||
report = [[Mike Pall, on May 2007]],
|
report = [[Mike Pall, on 05/2007]],
|
||||||
since = [[?]],
|
since = [[?]],
|
||||||
example = [[ ]],
|
example = [[ ]],
|
||||||
patch = [[
|
patch = [[
|
||||||
@ -1448,6 +1448,27 @@ not in 'lua_State'.)
|
|||||||
]],
|
]],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Bug{
|
||||||
|
what = [[wrong error message in some concatenations]],
|
||||||
|
report = [[Alex Davies, on 05/2007]],
|
||||||
|
since = [[5.1.2]],
|
||||||
|
example = [[a = nil; a = (1)..a]],
|
||||||
|
patch = [[
|
||||||
|
ldebug.c:
|
||||||
|
@@ -563,8 +563,8 @@
|
||||||
|
|
||||||
|
|
||||||
|
void luaG_concaterror (lua_State *L, StkId p1, StkId p2) {
|
||||||
|
- if (ttisstring(p1)) p1 = p2;
|
||||||
|
- lua_assert(!ttisstring(p1));
|
||||||
|
+ if (ttisstring(p1) || ttisnumber(p1)) p1 = p2;
|
||||||
|
+ lua_assert(!ttisstring(p1) && !ttisnumber(p1));
|
||||||
|
luaG_typeerror(L, p1, "concatenate");
|
||||||
|
}
|
||||||
|
|
||||||
|
]],
|
||||||
|
}
|
||||||
|
|
||||||
Bug{
|
Bug{
|
||||||
what = [[ ]],
|
what = [[ ]],
|
||||||
report = [[ , on ]],
|
report = [[ , on ]],
|
||||||
|
6
ldebug.c
6
ldebug.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: ldebug.c,v 2.35 2007/03/26 18:35:34 roberto Exp roberto $
|
** $Id: ldebug.c,v 2.36 2007/05/09 15:49:36 roberto Exp roberto $
|
||||||
** Debug Interface
|
** Debug Interface
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -591,8 +591,8 @@ void luaG_typeerror (lua_State *L, const TValue *o, const char *op) {
|
|||||||
|
|
||||||
|
|
||||||
void luaG_concaterror (lua_State *L, StkId p1, StkId p2) {
|
void luaG_concaterror (lua_State *L, StkId p1, StkId p2) {
|
||||||
if (ttisstring(p1)) p1 = p2;
|
if (ttisstring(p1) || ttisnumber(p1)) p1 = p2;
|
||||||
lua_assert(!ttisstring(p1));
|
lua_assert(!ttisstring(p1) && !ttisnumber(p2));
|
||||||
luaG_typeerror(L, p1, "concatenate");
|
luaG_typeerror(L, p1, "concatenate");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user