# HG changeset patch # User John W. Eaton # Date 1219262234 14400 # Node ID 24701aa75ecbe5f64da30b756890888a858ef029 # Parent faf0abc5fd515423c7b95083b03260bdfcc6f777 scope fixes for anonymous and inline functions that appear inside subfunctions diff -r faf0abc5fd51 -r 24701aa75ecb src/ov-fcn-inline.cc --- a/src/ov-fcn-inline.cc Wed Aug 20 15:14:54 2008 -0400 +++ b/src/ov-fcn-inline.cc Wed Aug 20 15:57:14 2008 -0400 @@ -91,7 +91,20 @@ octave_user_function *uf = fcn.user_function_value (); if (uf) - uf->stash_parent_fcn_scope (octave_call_stack::current_scope ()); + { + octave_function *curr_fcn = octave_call_stack::current (); + + if (curr_fcn) + { + symbol_table::scope_id parent_scope + = curr_fcn->parent_fcn_scope (); + + if (parent_scope < 0) + parent_scope = curr_fcn->scope (); + + uf->stash_parent_fcn_scope (parent_scope); + } + } } } diff -r faf0abc5fd51 -r 24701aa75ecb src/pt-fcn-handle.cc --- a/src/pt-fcn-handle.cc Wed Aug 20 15:14:54 2008 -0400 +++ b/src/pt-fcn-handle.cc Wed Aug 20 15:57:14 2008 -0400 @@ -114,7 +114,13 @@ if (curr_fcn) { uf->stash_parent_fcn_name (curr_fcn->name ()); - uf->stash_parent_fcn_scope (curr_fcn->scope ()); + + symbol_table::scope_id parent_scope = curr_fcn->parent_fcn_scope (); + + if (parent_scope < 0) + parent_scope = curr_fcn->scope (); + + uf->stash_parent_fcn_scope (parent_scope); } uf->mark_as_inline_function ();