diff src/vim9execute.c @ 21401:aa7675a4a0cd v8.2.1251

patch 8.2.1251: Vim9: warning for pointer usage, test failure undetected Commit: https://github.com/vim/vim/commit/682d0a15462f3d4f9404e98a56b340ae131cbb09 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jul 19 20:48:59 2020 +0200 patch 8.2.1251: Vim9: warning for pointer usage, test failure undetected Problem: Vim9: warning for pointer usage, test failure undetected. Solution: Fix pointer indirection. Give error when executing function failed for any reason. Fix instruction names.
author Bram Moolenaar <Bram@vim.org>
date Sun, 19 Jul 2020 21:00:03 +0200
parents 5cb6e676defd
children 0f0fee4122d3
line wrap: on
line diff
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -714,8 +714,7 @@ call_def_function(
     {
 	if (called_emsg == called_emsg_before)
 	    semsg(_("E1091: Function is not compiled: %s"),
-		    ufunc->uf_name_exp == NULL
-					? ufunc->uf_name : ufunc->uf_name_exp);
+						   printable_func_name(ufunc));
 	return FAIL;
     }
 
@@ -1139,10 +1138,10 @@ call_def_function(
 
 		    switch (iptr->isn_type)
 		    {
-			case ISN_LOADG: d = get_globvar_dict(); break;
-			case ISN_LOADB: d = &curbuf->b_vars; break;
-			case ISN_LOADW: d = &curwin->w_vars; break;
-			case ISN_LOADT: d = &curtab->tp_vars; break;
+			case ISN_LOADGDICT: d = get_globvar_dict(); break;
+			case ISN_LOADBDICT: d = curbuf->b_vars; break;
+			case ISN_LOADWDICT: d = curwin->w_vars; break;
+			case ISN_LOADTDICT: d = curtab->tp_vars; break;
 			default:  // Cannot reach here
 			    goto failed;
 		    }
@@ -2497,6 +2496,10 @@ failed_early:
 
     vim_free(ectx.ec_stack.ga_data);
     vim_free(ectx.ec_trystack.ga_data);
+
+    if (ret != OK && called_emsg == called_emsg_before)
+	semsg(_("E1099: Unknown error while executing %s"),
+						   printable_func_name(ufunc));
     return ret;
 }