diff src/if_lua.c @ 25394:3a8b61b31724 v8.2.3234

patch 8.2.3234: crash when printing long string with Lua Commit: https://github.com/vim/vim/commit/78e006b9b02fac94c910445d842f6dc5331fa57a Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jul 28 15:07:01 2021 +0200 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 https://github.com/vim/vim/issues/8648)
author Bram Moolenaar <Bram@vim.org>
date Wed, 28 Jul 2021 15:15:04 +0200
parents c4298ed56ffa
children 241d26b17192
line wrap: on
line diff
--- a/src/if_lua.c
+++ b/src/if_lua.c
@@ -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)