Mercurial > octave-nkf
diff src/ov-usr-fcn.cc @ 14328:19078011cdc3
fix problem with recursion and anonymous functions (bug #31371)
* ov-user-fcn.cc (octave_user_function::do_multi_index_op): Don't
increment the symbol table_context in the call stack or push a new
symbol table context for recursive anonymous function calls.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sun, 05 Feb 2012 13:16:07 -0500 |
parents | 8758dfa21cac |
children | b76f0740940e |
line wrap: on
line diff
--- a/src/ov-usr-fcn.cc Sat Feb 04 10:34:20 2012 -0500 +++ b/src/ov-usr-fcn.cc Sun Feb 05 13:16:07 2012 -0500 @@ -387,10 +387,12 @@ // Save old and set current symbol table context, for // eval_undefined_error(). - octave_call_stack::push (this, local_scope, call_depth); + int context = is_anonymous_function () ? 0 : call_depth; + + octave_call_stack::push (this, local_scope, context); frame.add_fcn (octave_call_stack::pop); - if (call_depth > 0) + if (call_depth > 0 && ! is_anonymous_function ()) { symbol_table::push_context ();