Mercurial > octave
changeset 24042:840882c82e22
install nested local functions only once (bug #51993)
* oct-parse.in.yy (base_parser::finish_function): Don't install nested
local functions as top-level local functions.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 14 Sep 2017 10:36:37 -0400 |
parents | 1d5c85655a8f |
children | f50ef29d874e |
files | libinterp/parse-tree/oct-parse.in.yy |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/parse-tree/oct-parse.in.yy Thu Sep 14 14:28:51 2017 +0200 +++ b/libinterp/parse-tree/oct-parse.in.yy Thu Sep 14 10:36:37 2017 -0400 @@ -3473,9 +3473,10 @@ } } - if (m_parsing_local_functions ) + if (m_parsing_local_functions && m_curr_fcn_depth == 1) symtab.install_local_function (nm, octave_value (fcn), file); - else if (m_curr_fcn_depth == 1) + + if (m_curr_fcn_depth == 1) fcn_scope->update_nest (); if (! m_lexer.reading_fcn_file && m_curr_fcn_depth == 1)