[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Comparing the binary chunk of two functions for equality
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Wed, 19 Feb 2014 12:56:21 -0300
> The only difference between the tow functions is an additional line feed
> after the comment. But it's enough to make the chunk unequal.
This is due to the debug information contained in the binary chunk.
Unfortunately, there is no public API for removing debug information.
If you can patch your version of Lua, just edit lapi.c and change
LUA_API int lua_dump (lua_State *L, lua_Writer writer, void *data) {
...
status = luaU_dump(L, getproto(o), writer, data, 0);
to
LUA_API int lua_dump (lua_State *L, lua_Writer writer, void *data, int strip) {
...
status = luaU_dump(L, getproto(o), writer, data, strip);
and call lua_dump with strip=1.