diff --git a/src/nvim/api/vimscript.c b/src/nvim/api/vimscript.c index 67db615b20..e2aac07258 100644 --- a/src/nvim/api/vimscript.c +++ b/src/nvim/api/vimscript.c @@ -229,10 +229,9 @@ static Object _call_function(String fn, Array args, dict_T *self, Arena *arena, funcexe.fe_selfdict = self; TRY_WRAP(err, { - // call_func() retval is deceptive, ignore it. Instead we set `msg_list` - // (see above) to capture abort-causing non-exception errors. - call_func(fn.data, (int)fn.size, &rettv, (int)args.size, - vim_args, &funcexe); + // call_func() retval is deceptive, ignore it. Instead TRY_WRAP sets `msg_list` to capture + // abort-causing non-exception errors. + (void)call_func(fn.data, (int)fn.size, &rettv, (int)args.size, vim_args, &funcexe); }); if (!ERROR_SET(err)) { @@ -280,18 +279,23 @@ Object nvim_call_dict_function(Object dict, String fn, Array args, Arena *arena, typval_T rettv; bool mustfree = false; switch (dict.type) { - case kObjectTypeString: + case kObjectTypeString: { + int eval_ret; TRY_WRAP(err, { - eval0(dict.data.string.data, &rettv, NULL, &EVALARG_EVALUATE); - clear_evalarg(&EVALARG_EVALUATE, NULL); - }); + eval_ret = eval0(dict.data.string.data, &rettv, NULL, &EVALARG_EVALUATE); + clear_evalarg(&EVALARG_EVALUATE, NULL); + }); if (ERROR_SET(err)) { return rv; } + if (eval_ret != OK) { + abort(); // Should not happen. + } // Evaluation of the string arg created a new dict or increased the // refcount of a dict. Not necessary for a RPC dict. mustfree = true; break; + } case kObjectTypeDict: object_to_vim(dict, &rettv, err); break;