lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


>>>>> "Andrew" == Andrew Gierth <andrew@tao11.riddles.org.uk> 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.

-- 
Andrew.