lua-users home
lua-l archive

Re: Comparing the binary chunk of two functions for equality

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


> luaL_loadstring( L, s1.c_str() );
luaL_loadstring(L,s) is equivalent to luaL_loadbuffer(L,s,strlen(s),s).
The 4th argument to luaL_loadbuffer is the source and this gets saved
by lua_dump. No wonder the binary chunks are different.
So, instead of luaL_loadstring(L,s1.c_str()), use
	luaL_loadbuffer(L, s1.c_str(), s1.length(), "=name")
to give the chunks the same "source".

AltStyle によって変換されたページ (->オリジナル) /