To: vim_dev@googlegroups.com Subject: Patch 8.2.1251 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1251 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. Files: src/vim9execute.c, src/userfunc.c, src/proto/userfunc.pro *** ../vim-8.2.1250/src/vim9execute.c 2020-07-19 19:47:32.093046796 +0200 --- src/vim9execute.c 2020-07-19 20:47:58.439171922 +0200 *************** *** 714,721 **** { 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); return FAIL; } --- 714,720 ---- { if (called_emsg == called_emsg_before) semsg(_("E1091: Function is not compiled: %s"), ! printable_func_name(ufunc)); return FAIL; } *************** *** 1139,1148 **** 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; default: // Cannot reach here goto failed; } --- 1138,1147 ---- switch (iptr->isn_type) { ! 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,2502 **** --- 2496,2505 ---- 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; } *** ../vim-8.2.1250/src/userfunc.c 2020-07-14 21:08:44.350001848 +0200 --- src/userfunc.c 2020-07-19 20:45:10.559693560 +0200 *************** *** 2122,2128 **** return ret; } ! static char_u * printable_func_name(ufunc_T *fp) { return fp->uf_name_exp != NULL ? fp->uf_name_exp : fp->uf_name; --- 2122,2128 ---- return ret; } ! char_u * printable_func_name(ufunc_T *fp) { return fp->uf_name_exp != NULL ? fp->uf_name_exp : fp->uf_name; *** ../vim-8.2.1250/src/proto/userfunc.pro 2020-07-01 17:28:30.339443259 +0200 --- src/proto/userfunc.pro 2020-07-19 20:45:29.383634410 +0200 *************** *** 22,27 **** --- 22,28 ---- int call_callback(callback_T *callback, int len, typval_T *rettv, int argcount, typval_T *argvars); void user_func_error(int error, char_u *name); int call_func(char_u *funcname, int len, typval_T *rettv, int argcount_in, typval_T *argvars_in, funcexe_T *funcexe); + char_u *printable_func_name(ufunc_T *fp); char_u *trans_function_name(char_u **pp, int *is_global, int skip, int flags, funcdict_T *fdp, partial_T **partial); char_u *untrans_function_name(char_u *name); ufunc_T *def_function(exarg_T *eap, char_u *name_arg); *** ../vim-8.2.1250/src/version.c 2020-07-19 19:47:32.093046796 +0200 --- src/version.c 2020-07-19 20:44:24.315839640 +0200 *************** *** 756,757 **** --- 756,759 ---- { /* Add new patch number below this line */ + /**/ + 1251, /**/ -- George: "I just got a new set of golf clubs for my wife!" John: "Great trade!" /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///