# HG changeset patch # User Max Brister # Date 1333140003 14400 # Node ID e0d66b8b0c6312d6b592254565ae2ebc14fb00ad # Parent cdc752aba9286295ad1e8e6bfd92326981f6bf3f Avoid double delete for nested functions in commandline * oct-parse.yy (finish_function): Only create a tree_function_def if current_depth is one. diff -r cdc752aba928 -r e0d66b8b0c63 src/oct-parse.yy --- a/src/oct-parse.yy Fri Mar 30 13:52:21 2012 -0400 +++ b/src/oct-parse.yy Fri Mar 30 16:40:03 2012 -0400 @@ -2941,15 +2941,16 @@ primary_fcn_scope); } - if (! reading_fcn_file) + if (! reading_fcn_file && current_function_depth == 1) { // We are either reading a script file or defining a function // at the command line, so this definition creates a // tree_function object that is placed in the parse tree. // Otherwise, it is just inserted in the symbol table, - // either as a subfunction (see above), or as the primary - // function for the file, via primary_fcn_ptr (see also - // load_fcn_from_file,, parse_fcn_file, and + // either as a subfunction or nested function (see above), + // or as the primary function for the file, via + // primary_fcn_ptr (see also load_fcn_from_file,, + // parse_fcn_file, and // symbol_table::fcn_info::fcn_info_rep::find_user_function). retval = new tree_function_def (fcn);