comparison 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
comparison
equal deleted inserted replaced
21400:9b9005a18282 21401:aa7675a4a0cd
712 || (ufunc->uf_def_status == UF_TO_BE_COMPILED 712 || (ufunc->uf_def_status == UF_TO_BE_COMPILED
713 && compile_def_function(ufunc, FALSE, NULL) == FAIL)) 713 && compile_def_function(ufunc, FALSE, NULL) == FAIL))
714 { 714 {
715 if (called_emsg == called_emsg_before) 715 if (called_emsg == called_emsg_before)
716 semsg(_("E1091: Function is not compiled: %s"), 716 semsg(_("E1091: Function is not compiled: %s"),
717 ufunc->uf_name_exp == NULL 717 printable_func_name(ufunc));
718 ? ufunc->uf_name : ufunc->uf_name_exp);
719 return FAIL; 718 return FAIL;
720 } 719 }
721 720
722 { 721 {
723 // Check the function was really compiled. 722 // Check the function was really compiled.
1137 { 1136 {
1138 dict_T *d = NULL; 1137 dict_T *d = NULL;
1139 1138
1140 switch (iptr->isn_type) 1139 switch (iptr->isn_type)
1141 { 1140 {
1142 case ISN_LOADG: d = get_globvar_dict(); break; 1141 case ISN_LOADGDICT: d = get_globvar_dict(); break;
1143 case ISN_LOADB: d = &curbuf->b_vars; break; 1142 case ISN_LOADBDICT: d = curbuf->b_vars; break;
1144 case ISN_LOADW: d = &curwin->w_vars; break; 1143 case ISN_LOADWDICT: d = curwin->w_vars; break;
1145 case ISN_LOADT: d = &curtab->tp_vars; break; 1144 case ISN_LOADTDICT: d = curtab->tp_vars; break;
1146 default: // Cannot reach here 1145 default: // Cannot reach here
1147 goto failed; 1146 goto failed;
1148 } 1147 }
1149 if (GA_GROW(&ectx.ec_stack, 1) == FAIL) 1148 if (GA_GROW(&ectx.ec_stack, 1) == FAIL)
1150 goto failed; 1149 goto failed;
2495 for (idx = 0; idx < ectx.ec_stack.ga_len; ++idx) 2494 for (idx = 0; idx < ectx.ec_stack.ga_len; ++idx)
2496 clear_tv(STACK_TV(idx)); 2495 clear_tv(STACK_TV(idx));
2497 2496
2498 vim_free(ectx.ec_stack.ga_data); 2497 vim_free(ectx.ec_stack.ga_data);
2499 vim_free(ectx.ec_trystack.ga_data); 2498 vim_free(ectx.ec_trystack.ga_data);
2499
2500 if (ret != OK && called_emsg == called_emsg_before)
2501 semsg(_("E1099: Unknown error while executing %s"),
2502 printable_func_name(ufunc));
2500 return ret; 2503 return ret;
2501 } 2504 }
2502 2505
2503 /* 2506 /*
2504 * ":dissassemble". 2507 * ":dissassemble".