aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/eval.c')
-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. */