diff options
-rw-r--r-- | src/nvim/ex_docmd.c | 10 | ||||
-rw-r--r-- | src/nvim/insexpand.c | 1 | ||||
-rw-r--r-- | src/nvim/mapping.c | 2 |
3 files changed, 9 insertions, 4 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index c4d2821e79..f52115ef0f 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -2852,11 +2852,13 @@ int parse_cmd_address(exarg_T *eap, char **errormsg, bool silent) if (!mark_check(fm)) { goto theend; } + assert(fm != NULL); eap->line1 = fm->mark.lnum; fm = mark_get_visual(curbuf, '>'); if (!mark_check(fm)) { goto theend; } + assert(fm != NULL); eap->line2 = fm->mark.lnum; eap->addr_count++; } @@ -3285,7 +3287,6 @@ int cmd_exists(const char *const name) /// "fullcommand" function void f_fullcommand(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - exarg_T ea; char *name = argvars[0].vval.v_string; rettv->v_type = VAR_STRING; @@ -3299,8 +3300,10 @@ void f_fullcommand(typval_T *argvars, typval_T *rettv, FunPtr fptr) } name = skip_range(name, NULL); - ea.cmd = (*name == '2' || *name == '3') ? name + 1 : name; - ea.cmdidx = (cmdidx_T)0; + exarg_T ea = { + .cmd = (*name == '2' || *name == '3') ? name + 1 : name, + .cmdidx = (cmdidx_T)0, + }; char *p = find_ex_command(&ea, NULL); if (p == NULL || ea.cmdidx == CMD_SIZE) { return; @@ -4390,6 +4393,7 @@ static linenr_T get_address(exarg_T *eap, char **ptr, cmd_addr_T addr_type, int cmd = NULL; goto error; } + assert(fm != NULL); lnum = fm->mark.lnum; } } diff --git a/src/nvim/insexpand.c b/src/nvim/insexpand.c index 141759de81..8ccda5c7cd 100644 --- a/src/nvim/insexpand.c +++ b/src/nvim/insexpand.c @@ -2509,6 +2509,7 @@ static int ins_compl_get_exp(pos_T *ini) } else if (ins_buf != curbuf && !buf_valid(ins_buf)) { ins_buf = curbuf; // In case the buffer was wiped out. } + assert(ins_buf != NULL); compl_old_match = compl_curr_match; // remember the last current match pos = (compl_direction == FORWARD) ? &last_match_pos : &first_match_pos; diff --git a/src/nvim/mapping.c b/src/nvim/mapping.c index 5a11ac686e..9d1a847663 100644 --- a/src/nvim/mapping.c +++ b/src/nvim/mapping.c @@ -2028,7 +2028,7 @@ static void get_maparg(typval_T *argvars, typval_T *rettv, int exact) int mode; bool abbr = false; bool get_dict = false; - mapblock_T *mp; + mapblock_T *mp = NULL; int buffer_local; int flags = REPTERM_FROM_PART | REPTERM_DO_LT; |