summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-01-07 20:59:34 +0100
committerBram Moolenaar <Bram@vim.org>2020-01-07 20:59:34 +0100
commite31ee86859528a7ffe00405645547d494e522fa8 (patch)
tree741c24aea3fae5efb613d64314a6721d6cad85c5 /src/main.c
parentce6db0273f2c4359f48d75103a42991aa481f14e (diff)
patch 8.2.0098: exe stack length can be wrong without being detectedv8.2.0098
Problem: Exe stack length can be wrong without being detected. Solution: Add a check when ABORT_ON_INTERNAL_ERROR is defined.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 51b8970b9b..117c2072e6 100644
--- a/src/main.c
+++ b/src/main.c
@@ -3086,16 +3086,19 @@ exe_pre_commands(mparm_T *parmp)
char_u **cmds = parmp->pre_commands;
int cnt = parmp->n_pre_commands;
int i;
+ ESTACK_CHECK_DECLARATION
if (cnt > 0)
{
curwin->w_cursor.lnum = 0; // just in case..
estack_push(ETYPE_ARGS, (char_u *)_("pre-vimrc command line"), 0);
+ ESTACK_CHECK_SETUP
# ifdef FEAT_EVAL
current_sctx.sc_sid = SID_CMDARG;
# endif
for (i = 0; i < cnt; ++i)
do_cmdline_cmd(cmds[i]);
+ ESTACK_CHECK_NOW
estack_pop();
# ifdef FEAT_EVAL
current_sctx.sc_sid = 0;
@@ -3111,6 +3114,7 @@ exe_pre_commands(mparm_T *parmp)
exe_commands(mparm_T *parmp)
{
int i;
+ ESTACK_CHECK_DECLARATION
/*
* We start commands on line 0, make "vim +/pat file" match a
@@ -3121,6 +3125,7 @@ exe_commands(mparm_T *parmp)
if (parmp->tagname == NULL && curwin->w_cursor.lnum <= 1)
curwin->w_cursor.lnum = 0;
estack_push(ETYPE_ARGS, (char_u *)"command line", 0);
+ ESTACK_CHECK_SETUP
#ifdef FEAT_EVAL
current_sctx.sc_sid = SID_CARG;
current_sctx.sc_seq = 0;
@@ -3131,6 +3136,7 @@ exe_commands(mparm_T *parmp)
if (parmp->cmds_tofree[i])
vim_free(parmp->commands[i]);
}
+ ESTACK_CHECK_NOW
estack_pop();
#ifdef FEAT_EVAL
current_sctx.sc_sid = 0;
@@ -3340,12 +3346,14 @@ process_env(
#ifdef FEAT_EVAL
sctx_T save_current_sctx;
#endif
+ ESTACK_CHECK_DECLARATION
if ((initstr = mch_getenv(env)) != NULL && *initstr != NUL)
{
if (is_viminit)
vimrc_found(NULL, NULL);
estack_push(ETYPE_ENV, env, 0);
+ ESTACK_CHECK_SETUP
#ifdef FEAT_EVAL
save_current_sctx = current_sctx;
current_sctx.sc_sid = SID_ENV;
@@ -3355,6 +3363,7 @@ process_env(
#endif
do_cmdline_cmd(initstr);
+ ESTACK_CHECK_NOW
estack_pop();
#ifdef FEAT_EVAL
current_sctx = save_current_sctx;