aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEliseo Martínez <eliseomarmol@gmail.com>2014-11-17 11:36:48 +0100
committerEliseo Martínez <eliseomarmol@gmail.com>2014-11-18 22:00:03 +0100
commit5c00f8c13244727845cd2de194f4e09c04ed4d8a (patch)
tree4bf62b6f04614be7a8fac15455b9c9a57b95321a /src
parent97be8d45f4e52aa33d37a831c26e24235ec55220 (diff)
downloadrneovim-5c00f8c13244727845cd2de194f4e09c04ed4d8a.tar.gz
rneovim-5c00f8c13244727845cd2de194f4e09c04ed4d8a.tar.bz2
rneovim-5c00f8c13244727845cd2de194f4e09c04ed4d8a.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/nvim/eval.c4
1 files changed, 3 insertions, 1 deletions
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. */