From 34a4a01e4efb690743de0fe60d98a3ebed1bd681 Mon Sep 17 00:00:00 2001 From: Eliseo Martínez Date: Mon, 17 Nov 2014 10:24:07 +0100 Subject: Fix warnings: eval.c: get_user_func_name(): Np dereference: FP. Problem : Dereference of null pointer @ 18216. Diagnostic : False positive. Rationale : `hi` and `done` are static. Intended usage is for the first call to have idx == 0, so that they are initialized. Resolution : Assert hi after (optional) initialization. --- src/nvim/eval.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nvim/eval.c b/src/nvim/eval.c index b8d1799e9a..af7a2d0118 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -18280,6 +18280,7 @@ char_u *get_user_func_name(expand_T *xp, int idx) done = 0; hi = func_hashtab.ht_array; } + assert(hi); if (done < func_hashtab.ht_used) { if (done++ > 0) ++hi; -- cgit