comparison libinterp/parse-tree/pt-eval.cc @ 30635:064a8fbf9162 stable

Assign error ID when parser fails because of incorrect number of function inputs/outputs (bug #61789) * pt-eval.cc (execute_user_function): Call error_with_id() and ID of "Octave:invalid-fun-call" instead of just error().
author Rik <rik@octave.org>
date Tue, 11 Jan 2022 12:43:53 -0800
parents 796f54d4ddbf
children ad8c9d93b86d a3a52d968f71
comparison
equal deleted inserted replaced
30633:754ad6e9c0a5 30635:064a8fbf9162
3416 3416
3417 if (! takes_varargs && nargin > max_inputs) 3417 if (! takes_varargs && nargin > max_inputs)
3418 { 3418 {
3419 std::string name = user_function.name (); 3419 std::string name = user_function.name ();
3420 3420
3421 error ("%s: function called with too many inputs", name.c_str ()); 3421 error_with_id ("Octave:invalid-fun-call",
3422 "%s: function called with too many inputs",
3423 name.c_str ());
3422 } 3424 }
3423 3425
3424 define_parameter_list_from_arg_vector (param_list, args); 3426 define_parameter_list_from_arg_vector (param_list, args);
3425 3427
3426 tree_parameter_list *ret_list = user_function.return_list (); 3428 tree_parameter_list *ret_list = user_function.return_list ();
3431 3433
3432 if (nargout > max_outputs) 3434 if (nargout > max_outputs)
3433 { 3435 {
3434 std::string name = user_function.name (); 3436 std::string name = user_function.name ();
3435 3437
3436 error ("%s: function called with too many outputs", name.c_str ()); 3438 error_with_id ("Octave:invalid-fun-call",
3439 "%s: function called with too many outputs",
3440 name.c_str ());
3437 } 3441 }
3438 } 3442 }
3439 3443
3440 bind_auto_fcn_vars (xargs.name_tags (), ignored_outputs, nargin, 3444 bind_auto_fcn_vars (xargs.name_tags (), ignored_outputs, nargin,
3441 nargout, user_function.takes_varargs (), 3445 nargout, user_function.takes_varargs (),