summaryrefslogtreecommitdiff
path: root/src/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/eval.c b/src/eval.c
index 680ca1af7..954e07fb4 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -2914,9 +2914,17 @@ eval_lambda(
semsg(_(e_missingparen), "lambda");
}
clear_tv(rettv);
- return FAIL;
+ ret = FAIL;
}
- return call_func_rettv(arg, rettv, evaluate, NULL, &base);
+ else
+ ret = call_func_rettv(arg, rettv, evaluate, NULL, &base);
+
+ // Clear the funcref afterwards, so that deleting it while
+ // evaluating the arguments is possible (see test55).
+ if (evaluate)
+ clear_tv(&base);
+
+ return ret;
}
/*