Mercurial > octave-nkf
diff src/variables.cc @ 9144:c6463412aebb
eliminate symbol_table::scope_stack; fix scoping issue with evalin
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 21 Apr 2009 15:39:57 -0400 |
parents | 4cb9f994dcec |
children | 5579998f8acf |
line wrap: on
line diff
--- a/src/variables.cc Tue Apr 21 10:00:11 2009 -0700 +++ b/src/variables.cc Tue Apr 21 15:39:57 2009 -0400 @@ -1381,14 +1381,16 @@ { std::string nm = argv [i + 1]; - symbol_table::scope_id tmp_scope = symbol_table::alloc_scope (); - unwind_protect::begin_frame ("do_who_file"); - symbol_table::push_scope (tmp_scope); - symbol_table::push_context (); - octave_call_stack::push (0); + // Set up temporary scope. + symbol_table::scope_id tmp_scope = symbol_table::alloc_scope (); + unwind_protect::add (symbol_table::erase_scope, &tmp_scope); + + symbol_table::set_scope (tmp_scope); + + octave_call_stack::push (tmp_scope, 0); unwind_protect::add (octave_call_stack::unwind_pop, 0); unwind_protect::add (symbol_table::clear_variables); @@ -1404,8 +1406,6 @@ } unwind_protect::run_frame ("do_who_file"); - - symbol_table::erase_scope (tmp_scope); } return retval;