From 5c00f8c13244727845cd2de194f4e09c04ed4d8a Mon Sep 17 00:00:00 2001 From: Eliseo Martínez Date: Mon, 17 Nov 2014 11:36:48 +0100 Subject: Fix warnings: eval.c: do_return(): Np dereference: FP. Problem : Dereference of null pointer @ 18841. Diagnostic : False positive. Rationale : Suggested error path takes `reanimate` branch at 18827, assigning `rettv = current_funccal->rettv`. Then, inmediately after, it supposes rettv is null, which cannot happen, since current_funccal->rettv should always be non null. Resolution : Assert current_funccal->rettv non null. --- src/nvim/eval.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/nvim/eval.c b/src/nvim/eval.c index b4eb6053a7..393fab1404 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -18901,8 +18901,10 @@ int do_return(exarg_T *eap, int reanimate, int is_cmd, void *rettv) else { /* When undoing a return in order to make it pending, get the stored * return rettv. */ - if (reanimate) + if (reanimate) { + assert(current_funccal->rettv); rettv = current_funccal->rettv; + } if (rettv != NULL) { /* Store the value of the pending return. */ -- cgit