checkversion bug?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

checkversion bug?

Grey Knight-2
Hello,

I found what looks like a bug in luaL_checkversion_(): it is checking for matching versions by comparing the (lua_Number*) pointers returned from lua_version().
Presumably it should be comparing the numbers stored at those pointers instead. :-)

--
GreyKnight

Reply | Threaded
Open this post in threaded view
|

Re: checkversion bug?

Peter Cawley
The pointer comparison is deliberate, and is intended to catch
scenarios where you've linked multiple copies of the Lua VM into your
application and are erroneously passing states created with one copy
into a different copy.

On Sat, May 28, 2016 at 3:03 PM, Grey Knight
<[hidden email]> wrote:
> Hello,
>
> I found what looks like a bug in luaL_checkversion_(): it is checking for matching versions by comparing the (lua_Number*) pointers returned from lua_version().
> Presumably it should be comparing the numbers stored at those pointers instead. :-)
>
> --
> GreyKnight
>