summaryrefslogtreecommitdiff
path: root/src/vim9execute.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vim9execute.c')
-rw-r--r--src/vim9execute.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/vim9execute.c b/src/vim9execute.c
index 6e011ba2f..d3e2af772 100644
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -3962,9 +3962,16 @@ on_fatal_error:
done:
// function finished, get result from the stack.
- tv = STACK_TV_BOT(-1);
- *rettv = *tv;
- tv->v_type = VAR_UNKNOWN;
+ if (ufunc->uf_ret_type == &t_void)
+ {
+ rettv->v_type = VAR_VOID;
+ }
+ else
+ {
+ tv = STACK_TV_BOT(-1);
+ *rettv = *tv;
+ tv->v_type = VAR_UNKNOWN;
+ }
ret = OK;
failed: