lua

A copy of the Lua development repository
Log | Files | Refs | README

commit 14115170bc9411e1c13871b87e50d83d60a4bb1c
parent ec52149485e96ae2df805614a5a91c7385e217e6
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Wed, 17 Jun 2009 15:38:30 -0300

lua_objlen should not work for numbers (according to the manual)

Diffstat:
Mlapi.c | 9+--------
1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/lapi.c b/lapi.c @@ -1,5 +1,5 @@ /* -** $Id: lapi.c,v 2.79 2009/06/15 19:51:31 roberto Exp roberto $ +** $Id: lapi.c,v 2.80 2009/06/17 17:52:57 roberto Exp roberto $ ** Lua API ** See Copyright Notice in lua.h */ @@ -357,13 +357,6 @@ LUA_API size_t lua_objlen (lua_State *L, int idx) { case LUA_TSTRING: return tsvalue(o)->len; case LUA_TUSERDATA: return uvalue(o)->len; case LUA_TTABLE: return luaH_getn(hvalue(o)); - case LUA_TNUMBER: { - size_t l; - lua_lock(L); /* `luaV_tostring' may create a new string */ - l = (luaV_tostring(L, o) ? tsvalue(o)->len : 0); - lua_unlock(L); - return l; - } default: return 0; } }