aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/api/vim.c3
-rw-r--r--src/nvim/eval/encode.c7
-rw-r--r--src/nvim/ex_cmds.c12
-rw-r--r--src/nvim/extmark.c1
4 files changed, 15 insertions, 8 deletions
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c
index 6501ae2c89..cf822782d8 100644
--- a/src/nvim/api/vim.c
+++ b/src/nvim/api/vim.c
@@ -2687,6 +2687,9 @@ void nvim__screenshot(String path)
static void clear_provider(DecorProvider *p)
{
+ if (p == NULL) {
+ return;
+ }
NLUA_CLEAR_REF(p->redraw_start);
NLUA_CLEAR_REF(p->redraw_buf);
NLUA_CLEAR_REF(p->redraw_win);
diff --git a/src/nvim/eval/encode.c b/src/nvim/eval/encode.c
index 137f099df6..9a9f2e4287 100644
--- a/src/nvim/eval/encode.c
+++ b/src/nvim/eval/encode.c
@@ -159,8 +159,11 @@ static int conv_error(const char *const msg, const MPConvStack *const mpstack,
vim_snprintf((char *)IObuff, IOSIZE, idx_msg, idx);
ga_concat(&msg_ga, IObuff);
} else {
- typval_T key_tv = *TV_LIST_ITEM_TV(
- tv_list_first(TV_LIST_ITEM_TV(li)->vval.v_list));
+ assert(li != NULL);
+ listitem_T *const first_item =
+ tv_list_first(TV_LIST_ITEM_TV(li)->vval.v_list);
+ assert(first_item != NULL);
+ typval_T key_tv = *TV_LIST_ITEM_TV(first_item);
char *const key = encode_tv2echo(&key_tv, NULL);
vim_snprintf((char *) IObuff, IOSIZE, key_pair_msg, key, idx);
xfree(key);
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index 3e49d7845d..55366842b0 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -3451,13 +3451,13 @@ static buf_T *do_sub(exarg_T *eap, proftime_T timeout,
sub_firstline = NULL;
- /*
- * ~ in the substitute pattern is replaced with the old pattern.
- * We do it here once to avoid it to be replaced over and over again.
- * But don't do it when it starts with "\=", then it's an expression.
- */
- if (!(sub[0] == '\\' && sub[1] == '='))
+ // ~ in the substitute pattern is replaced with the old pattern.
+ // We do it here once to avoid it to be replaced over and over again.
+ // But don't do it when it starts with "\=", then it's an expression.
+ assert(sub != NULL);
+ if (!(sub[0] == '\\' && sub[1] == '=')) {
sub = regtilde(sub, p_magic);
+ }
// Check for a match on each line.
// If preview: limit to max('cmdwinheight', viewport).
diff --git a/src/nvim/extmark.c b/src/nvim/extmark.c
index 413ea4116a..ba685b158e 100644
--- a/src/nvim/extmark.c
+++ b/src/nvim/extmark.c
@@ -74,6 +74,7 @@ uint64_t extmark_set(buf_T *buf, uint64_t ns_id, uint64_t id,
Decoration *decor, ExtmarkOp op)
{
ExtmarkNs *ns = buf_ns_ref(buf, ns_id, true);
+ assert(ns != NULL);
mtpos_t old_pos;
uint64_t mark = 0;