aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/lua/executor.c
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2019-08-04 19:42:31 +0200
committerBjörn Linse <bjorn.linse@gmail.com>2019-08-05 13:19:44 +0200
commite6d77993d1167f4c15c9f67c0c3281444b1d18c2 (patch)
tree446e6c2cbd0a036d5444f2bf4743c305a57e9bd5 /src/nvim/lua/executor.c
parentd3a7bdefb0782179433f42f8be8a35816a04f68e (diff)
downloadrneovim-e6d77993d1167f4c15c9f67c0c3281444b1d18c2.tar.gz
rneovim-e6d77993d1167f4c15c9f67c0c3281444b1d18c2.tar.bz2
rneovim-e6d77993d1167f4c15c9f67c0c3281444b1d18c2.zip
lua: do not crash on syntax error in debug.debug()
Diffstat (limited to 'src/nvim/lua/executor.c')
-rw-r--r--src/nvim/lua/executor.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c
index 44d56e770c..1f2651e243 100644
--- a/src/nvim/lua/executor.c
+++ b/src/nvim/lua/executor.c
@@ -449,11 +449,10 @@ int nlua_debug(lua_State *lstate)
if (luaL_loadbuffer(lstate, (const char *)input.vval.v_string,
STRLEN(input.vval.v_string), "=(debug command)")) {
nlua_error(lstate, _("E5115: Error while loading debug string: %.*s"));
- }
- tv_clear(&input);
- if (lua_pcall(lstate, 0, 0, 0)) {
+ } else if (lua_pcall(lstate, 0, 0, 0)) {
nlua_error(lstate, _("E5116: Error while calling debug string: %.*s"));
}
+ tv_clear(&input);
}
return 0;
}