[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.2 string formatting check fails when using integers
- From: Roberto Ierusalimschy <roberto@...>
- Date: Fri, 13 Apr 2012 13:15:21 -0300
> We run Lua 5.2 in an embedded device and have changed lua_Number to
> the C type int.
>
> There are a few problems with this in the new Lua 5.2
>
> In lstrlib.c line 883, please consider changing:
> luaL_argcheck(L, 0 <= n && n < (MAX_UINTFRM + 1), arg,
> to:
> luaL_argcheck(L, 0 <= n && (unsigned LUA_INTFRM_T)n <= (MAX_UINTFRM), arg,
I think this change does not work with the regular setting:
> return string.format("%x", 2^64)
0
(It should give an error in this case.)
-- Roberto