# HG changeset patch # User John W. Eaton # Date 1218572813 14400 # Node ID 2fd4a5ef6b593a531f248d25341e7e25d4d979e3 # Parent d9987dbdf91bfa615f784733ac7e940d9ac921b8 stash parent function scope for inline functions and anonymous function handles. diff -r d9987dbdf91b -r 2fd4a5ef6b59 src/ChangeLog --- a/src/ChangeLog Tue Aug 12 13:20:27 2008 -0400 +++ b/src/ChangeLog Tue Aug 12 16:26:53 2008 -0400 @@ -1,5 +1,10 @@ 2008-08-12 John W. Eaton + * pt-fcn-handle.cc (tree_anon_fcn_handle::rvalue): + Call stash_parent_function_scope for user function. + * ov-fcn-inline.cc (octave_fcn_inline::octave_fcn_inline): + Likewise. + * ov-struct.cc (octave_struct::subsref): Don't allow resizing for simple x(idx) case. diff -r d9987dbdf91b -r 2fd4a5ef6b59 src/ov-fcn-inline.cc --- a/src/ov-fcn-inline.cc Tue Aug 12 13:20:27 2008 -0400 +++ b/src/ov-fcn-inline.cc Tue Aug 12 16:26:53 2008 -0400 @@ -39,9 +39,11 @@ #include "oct-map.h" #include "ov-base.h" #include "ov-fcn-inline.h" +#include "ov-usr-fcn.h" #include "pr-output.h" #include "variables.h" #include "parse.h" +#include "toplev.h" #include "byte-swap.h" #include "ls-oct-ascii.h" @@ -83,7 +85,14 @@ octave_fcn_handle *fh = anon_fcn_handle.fcn_handle_value (); if (fh) - fcn = fh->fcn_val (); + { + fcn = fh->fcn_val (); + + octave_user_function *uf = fcn.user_function_value (); + + if (uf) + uf->stash_parent_fcn_scope (octave_call_stack::current_scope ()); + } } if (fcn.is_undefined ()) diff -r d9987dbdf91b -r 2fd4a5ef6b59 src/pt-fcn-handle.cc --- a/src/pt-fcn-handle.cc Tue Aug 12 13:20:27 2008 -0400 +++ b/src/pt-fcn-handle.cc Tue Aug 12 16:26:53 2008 -0400 @@ -112,7 +112,10 @@ octave_function *curr_fcn = octave_call_stack::current (); if (curr_fcn) - uf->stash_parent_fcn_name (curr_fcn->name ()); + { + uf->stash_parent_fcn_name (curr_fcn->name ()); + uf->stash_parent_fcn_scope (curr_fcn->scope ()); + } uf->mark_as_inline_function ();