aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/api/vim.c1
-rw-r--r--src/nvim/eval.c10
-rw-r--r--src/nvim/ex_cmds2.c2
-rw-r--r--src/nvim/ex_session.c2
-rw-r--r--src/nvim/marktree.c2
5 files changed, 11 insertions, 6 deletions
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c
index 99a41f4f6f..60535b13b3 100644
--- a/src/nvim/api/vim.c
+++ b/src/nvim/api/vim.c
@@ -2954,6 +2954,7 @@ void nvim_set_decoration_provider(Integer ns_id, DictionaryOf(LuaRef) opts,
FUNC_API_SINCE(7) FUNC_API_LUA_ONLY
{
DecorProvider *p = get_decor_provider((NS)ns_id, true);
+ assert(p != NULL);
decor_provider_clear(p);
// regardless of what happens, it seems good idea to redraw
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index a75cc78b7e..a3fa9c986f 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -7200,9 +7200,13 @@ bool callback_from_typval(Callback *const callback, typval_T *const arg)
r = FAIL;
} else if (arg->v_type == VAR_FUNC || arg->v_type == VAR_STRING) {
char_u *name = arg->vval.v_string;
- func_ref(name);
- callback->data.funcref = vim_strsave(name);
- callback->type = kCallbackFuncref;
+ if (name != NULL) {
+ func_ref(name);
+ callback->data.funcref = vim_strsave(name);
+ callback->type = kCallbackFuncref;
+ } else {
+ r = FAIL;
+ }
} else if (nlua_is_table_from_lua(arg)) {
char_u *name = nlua_register_table_as_callable(arg);
diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c
index 0a2802397d..56a14887df 100644
--- a/src/nvim/ex_cmds2.c
+++ b/src/nvim/ex_cmds2.c
@@ -2958,7 +2958,7 @@ int do_source(char_u *fname, int check_other, int is_vimrc)
}
if (l_do_profiling == PROF_YES) {
- bool forceit;
+ bool forceit = false;
// Check if we do profiling for this script.
if (!si->sn_prof_on && has_profiling(true, si->sn_name, &forceit)) {
diff --git a/src/nvim/ex_session.c b/src/nvim/ex_session.c
index c1e52d6994..481febd16b 100644
--- a/src/nvim/ex_session.c
+++ b/src/nvim/ex_session.c
@@ -725,7 +725,7 @@ static int makeopens(FILE *fd, char_u *dirnow)
}
}
- if (tab_firstwin->w_next != NULL) {
+ if (tab_firstwin != NULL && tab_firstwin->w_next != NULL) {
// Go to the first window.
PUTLINE_FAIL("wincmd t");
diff --git a/src/nvim/marktree.c b/src/nvim/marktree.c
index b3afdefac1..34acf64d83 100644
--- a/src/nvim/marktree.c
+++ b/src/nvim/marktree.c
@@ -849,7 +849,7 @@ bool marktree_splice(MarkTree *b,
MarkTreeIter itr[1] = { 0 };
MarkTreeIter enditr[1] = { 0 };
- mtpos_t oldbase[MT_MAX_DEPTH];
+ mtpos_t oldbase[MT_MAX_DEPTH] = { 0 };
marktree_itr_get_ext(b, start, itr, false, true, oldbase);
if (!itr->node) {