0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

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.
This commit is contained in:
Bram Moolenaar
2022-03-15 19:29:30 +00:00
parent 48f69cdfa4
commit 139575de66
9 changed files with 58 additions and 43 deletions

View File

@@ -355,15 +355,16 @@ compile_load_scriptvar(
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_lambda(char_u **arg, cctx_T *cctx)
)
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