Skip to content
Snippets Groups Projects
Commit 90ef664e authored by Roman Tsisyk's avatar Roman Tsisyk
Browse files

lua: fix lua_tointeger() usage on 32-bit platforms

lua_tointeger() is equivalent to (ptrdiff_t)lua_tonumber(L),
which causes precision loss on 32-bit systems when you expect
to get a proper uint32_t value. LuaJIT stores numbers as doubles,
so lua_tointeger() makes absolutely no sense.

Replace lua_tointeger() with lua_tonumber() everywhere except
cases when result is converted to int or lua_Integer.

Fixes box/indices_any_type.test.lua on i386 and armhf

Closes #2459
parent 3e1b734b
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment