[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua 5.4.2 crashes where Lua 5.3.6 does not
- From: Andrew Gierth <andrew@...>
- Date: Sat, 19 Dec 2020 10:25:07 +0000
>>>>> "Andrew" == Andrew Gierth <firstname.lastname@example.org> writes:
Andrew> The overwhelmingly most likely cause for the crash here is that
Andrew> you changed the Lua stack in an unbalanced way between a
Andrew> previous add* call and this one.
And indeed, what you do to the stack in the deentify / deentifyn
functions is a classic example of violating the luaL_Buffer protocol -
you're assuming you can push something, do an addstring, and then pop
the thing that you pushed - but this is explicitly forbidden, since
addstring is allowed to push new entries on the stack.
You should be able to fix it fairly simply by using luaL_addvalue
instead of lua_tolstring / luaL_addlstring.