summaryrefslogtreecommitdiffstats
path: root/src/vim9compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vim9compile.c')
-rw-r--r--src/vim9compile.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 40411c4d3a..d7c7c8be83 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -1024,9 +1024,11 @@ generate_UCALL(cctx_T *cctx, char_u *name, int argcount)
isn->isn_arg.ufunc.cuf_argcount = argcount;
stack->ga_len -= argcount; // drop the arguments
-
- // drop the funcref/partial, get back the return value
- ((type_T **)stack->ga_data)[stack->ga_len - 1] = &t_any;
+ if (ga_grow(stack, 1) == FAIL)
+ return FAIL;
+ // add return value
+ ((type_T **)stack->ga_data)[stack->ga_len] = &t_any;
+ ++stack->ga_len;
return OK;
}