# HG changeset patch # User John W. Eaton # Date 1505943925 14400 # Node ID 5bf2e2ceace2f66db900347f7dbaf897b664d396 # Parent c81ed514ca2cdab2d30334a39b96287ea6124d14 only cache parent function in anonymous function scopes * symtab.cc (symbol_table::scope::set_parent): Only cache parent function in anonymous function scopes. See also changeset ef85638c605a. diff -r c81ed514ca2c -r 5bf2e2ceace2 libinterp/corefcn/symtab.cc --- a/libinterp/corefcn/symtab.cc Mon Sep 18 12:49:54 2017 -0400 +++ b/libinterp/corefcn/symtab.cc Wed Sep 20 17:45:25 2017 -0400 @@ -1825,10 +1825,15 @@ // If m_parent is the top-level scope, there will be no parent // function. - octave_function *ov_fcn = m_parent->function (); + octave_function *current_fcn = function (); - if (ov_fcn) - m_parent_fcn = octave_value (ov_fcn, true); + if (current_fcn && current_fcn->is_anonymous_function ()) + { + octave_function *parent_fcn = m_parent->function (); + + if (parent_fcn) + m_parent_fcn = octave_value (parent_fcn, true); + } } }