0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.3234: crash when printing long string with Lua

Problem:    Crash when printing long string with Lua.
Solution:   Remove lua_pop(). (Martin Tournoij, closes #8648)
This commit is contained in:
Bram Moolenaar
2021-07-28 15:07:01 +02:00
parent e2390c7f32
commit 78e006b9b0
3 changed files with 22 additions and 2 deletions

View File

@@ -1734,9 +1734,9 @@ luaV_print(lua_State *L)
s = lua_tolstring(L, -1, &l);
if (s == NULL)
return luaL_error(L, "cannot convert to string");
if (i > 1) luaL_addchar(&b, ' '); // use space instead of tab
if (i > 1)
luaL_addchar(&b, ' '); // use space instead of tab
luaV_addlstring(&b, s, l, 0);
lua_pop(L, 1);
}
luaL_pushresult(&b);
if (!got_int)