# HG changeset patch # User John W. Eaton # Date 1328465767 18000 # Node ID 19078011cdc30075740cf93e63569900440cd341 # Parent 63f1bdf083397aafcc4d244c65fb3291ba562a6b 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. diff -r 63f1bdf08339 -r 19078011cdc3 src/ov-usr-fcn.cc --- 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 ();