[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Strange behaviour of custom lua_gettop
- From: Peter Cawley <lua@...>
- Date: Fri, 12 Jul 2013 17:10:08 +0100
On Fri, Jul 12, 2013 at 5:05 PM, Dirk Laurie <firstname.lastname@example.org> wrote:
> 2013/7/12 lua 4web <email@example.com>:
>> This is strange considering my_gettop is a copy of lua_gettop.
>> I have noticed a pattern in seemingly random numbers produced by
>> my_gettop(i.e. 1431655765 = 0x55555555), but I have no idea why it
>> produces them instead of correct results.
>> I'm sure I've made a simple mistake somewhere, can anybody help me find it?
> Your code works on the current version 5.2.2 on my system.
I suspect that within the Lua core, TValue is defined to be an 8-byte
NaN packed value, whereas in your test.c, TValue is defined to be a
In a 64-bit environment, TValue is a 16-byte structure within the Lua
core, so the code will only break in a 32-bit environment.