Mercurial > octave
diff libinterp/corefcn/help.cc @ 25394:9e39a53b4e00 stable
make listing local functions for command completion work again (bug #53925)
* help.cc (help_system::local_functions): Check curr_fcn before loop.
* ov-usr-fcn.h (octave_user_function::parent_fcn_scope):
New function. Oops.
* oct-parse.in.yy (base_parser::start_function): Don't cache parent
function info in subfunctions here. It is already done in
finish_function, which also handles nested functions.
(base_parser::finish_function): Also cache parent function name in
subfunction.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 18 May 2018 19:26:41 -0400 |
parents | 644fe81ced33 |
children | a656665b671d |
line wrap: on
line diff
--- a/libinterp/corefcn/help.cc Thu May 17 11:54:54 2018 -0700 +++ b/libinterp/corefcn/help.cc Fri May 18 19:26:41 2018 -0400 @@ -488,16 +488,19 @@ octave_user_code *curr_fcn = cs.caller_user_code (); + if (! curr_fcn) + return retval; + // All subfunctions are listed in the top-level function of this file. - while (curr_fcn && curr_fcn->is_subfunction ()) + // If curr_fcn is a subfunction, then there must be a parent and + // curr_fcn will always be valid in and after executing this loop. + + while (curr_fcn->is_subfunction ()) { symbol_scope pscope = curr_fcn->parent_fcn_scope (); curr_fcn = pscope.function (); } - if (! curr_fcn) - return retval; - // Get subfunctions. const std::list<std::string> names = curr_fcn->subfunction_names ();