1
0
forked from aniani/vim

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

@@ -913,8 +913,7 @@ compile_nested_function(exarg_T *eap, cctx_T *cctx, garray_T *lines_to_free)
}
}
update_has_breakpoint(ufunc);
compile_type = COMPILE_TYPE(ufunc);
compile_type = get_compile_type(ufunc);
#ifdef FEAT_PROFILE
// If the outer function is profiled, also compile the nested function for
// profiling.
@@ -2475,6 +2474,30 @@ check_args_shadowing(ufunc_T *ufunc, cctx_T *cctx)
return r;
}
/*
* Get the compilation type that should be used for "ufunc".
* Keep in sync with INSTRUCTIONS().
*/
compiletype_T
get_compile_type(ufunc_T *ufunc)
{
// Update uf_has_breakpoint if needed.
update_has_breakpoint(ufunc);
if (debug_break_level > 0 || may_break_in_function(ufunc))
return CT_DEBUG;
#ifdef FEAT_PROFILE
if (do_profiling == PROF_YES)
{
if (!ufunc->uf_profiling && has_profiling(FALSE, ufunc->uf_name, NULL))
func_do_profile(ufunc);
if (ufunc->uf_profiling)
return CT_PROFILE;
}
#endif
return CT_NONE;
}
/*
* Add a function to the list of :def functions.