lua-users home
lua-l archive

[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".