patch 8.2.4575: Vim9: test for profiling still fails
Problem: Vim9: test for profiling still fails.
Solution: Update flags for profiling and breakpoints when obtaining the
compile type. Do not set the FC_CLOSURE flag for a toplevel
function.
diff --git a/src/vim9expr.c b/src/vim9expr.c
index e2e4f8e..8276a77 100644
--- a/src/vim9expr.c
+++ b/src/vim9expr.c
@@ -355,15 +355,16 @@
generate_funcref(cctx_T *cctx, char_u *name, int has_g_prefix)
{
ufunc_T *ufunc = find_func(name, FALSE);
+ compiletype_T compile_type;
// Reject a global non-autoload function found without the "g:" prefix.
if (ufunc == NULL || (!has_g_prefix && func_requires_g_prefix(ufunc)))
return FAIL;
// Need to compile any default values to get the argument types.
- if (func_needs_compiling(ufunc, COMPILE_TYPE(ufunc))
- && compile_def_function(ufunc, TRUE, COMPILE_TYPE(ufunc), NULL)
- == FAIL)
+ compile_type = get_compile_type(ufunc);
+ if (func_needs_compiling(ufunc, compile_type)
+ && compile_def_function(ufunc, TRUE, compile_type, cctx) == FAIL)
return FAIL;
return generate_PUSHFUNC(cctx, ufunc->uf_name, ufunc->uf_func_type);
}
@@ -1007,12 +1008,14 @@
)
compile_def_function(ufunc, FALSE, CT_NONE, cctx);
- // if the outer function is not compiled for debugging, this one might be
- if (cctx->ctx_compile_type != CT_DEBUG)
+ // if the outer function is not compiled for debugging or profiling, this
+ // one might be
+ if (cctx->ctx_compile_type == CT_NONE)
{
- update_has_breakpoint(ufunc);
- if (COMPILE_TYPE(ufunc) == CT_DEBUG)
- compile_def_function(ufunc, FALSE, CT_DEBUG, cctx);
+ compiletype_T compile_type = get_compile_type(ufunc);
+
+ if (compile_type != CT_NONE)
+ compile_def_function(ufunc, FALSE, compile_type, cctx);
}
// The last entry in evalarg.eval_tofree_ga is a copy of the last line and