From d70a0c91ad42275af1f6f1b6e37c604442b3f0d1 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 15 Dec 2022 16:44:22 -0300 Subject: Dump/undump reuse strings A repeated string in a dump is represented as an index to its first occurence, instead of another copy of the string. --- lstrlib.c | 1 + 1 file changed, 1 insertion(+) (limited to 'lstrlib.c') diff --git a/lstrlib.c b/lstrlib.c index 0b4fdbb7..ce07d9bc 100644 --- a/lstrlib.c +++ b/lstrlib.c @@ -239,6 +239,7 @@ static int str_dump (lua_State *L) { if (l_unlikely(lua_dump(L, writer, &state, strip) != 0)) return luaL_error(L, "unable to dump given function"); luaL_pushresult(&state.B); + lua_assert(lua_isfunction(L, 1)); /* lua_dump kept that value */ return 1; } -- cgit v1.2.3-55-g6feb