diff src/vim9execute.c @ 28101:3bc0a639dfb0 v8.2.4575

patch 8.2.4575: Vim9: test for profiling still fails Commit: https://github.com/vim/vim/commit/139575de6653e7fd5807cb036dfb3684b815c519 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Mar 15 19:29:30 2022 +0000 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.
author Bram Moolenaar <Bram@vim.org>
date Tue, 15 Mar 2022 20:30:03 +0100
parents 632a84e2ce92
children ed151877ebac
line wrap: on
line diff
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -284,6 +284,7 @@ call_dfunc(
     estack_T	*entry;
     funclocal_T	*floc = NULL;
     int		res = OK;
+    compiletype_T compile_type;
 
     if (dfunc->df_deleted)
     {
@@ -309,14 +310,12 @@ call_dfunc(
     }
 #endif
 
-    // Update uf_has_breakpoint if needed.
-    update_has_breakpoint(ufunc);
-
     // When debugging and using "cont" switches to the not-debugged
     // instructions, may need to still compile them.
-    if (func_needs_compiling(ufunc, COMPILE_TYPE(ufunc)))
+    compile_type = get_compile_type(ufunc);
+    if (func_needs_compiling(ufunc, compile_type))
     {
-	res = compile_def_function(ufunc, FALSE, COMPILE_TYPE(ufunc), NULL);
+	res = compile_def_function(ufunc, FALSE, compile_type, NULL);
 
 	// compile_def_function() may cause def_functions.ga_data to change
 	dfunc = ((dfunc_T *)def_functions.ga_data) + cdf_idx;
@@ -926,7 +925,7 @@ call_ufunc(
     int		error;
     int		idx;
     int		did_emsg_before = did_emsg;
-    compiletype_T compile_type = COMPILE_TYPE(ufunc);
+    compiletype_T compile_type = get_compile_type(ufunc);
 
     if (func_needs_compiling(ufunc, compile_type)
 		&& compile_def_function(ufunc, FALSE, compile_type, NULL)
@@ -4993,14 +4992,11 @@ call_def_function(
 #undef STACK_TV_VAR
 #define STACK_TV_VAR(idx) (((typval_T *)ectx.ec_stack.ga_data) + ectx.ec_frame_idx + STACK_FRAME_SIZE + idx)
 
-    // Update uf_has_breakpoint if needed.
-    update_has_breakpoint(ufunc);
-
     if (ufunc->uf_def_status == UF_NOT_COMPILED
 	    || ufunc->uf_def_status == UF_COMPILE_ERROR
-	    || (func_needs_compiling(ufunc, COMPILE_TYPE(ufunc))
-		&& compile_def_function(ufunc, FALSE, COMPILE_TYPE(ufunc), NULL)
-								      == FAIL))
+	    || (func_needs_compiling(ufunc, get_compile_type(ufunc))
+		&& compile_def_function(ufunc, FALSE,
+				       get_compile_type(ufunc), NULL) == FAIL))
     {
 	if (did_emsg_cumul + did_emsg == did_emsg_before)
 	    semsg(_(e_function_is_not_compiled_str),