Mercurial > octave-nkf
diff src/pt-except.cc @ 4699:5e2c68946f30
[project @ 2004-01-20 23:04:46 by jwe]
author | jwe |
---|---|
date | Tue, 20 Jan 2004 23:04:47 +0000 |
parents | c1f6200b5f0e |
children | a62215ab8a03 |
line wrap: on
line diff
--- a/src/pt-except.cc Mon Jan 19 19:25:27 2004 +0000 +++ b/src/pt-except.cc Tue Jan 20 23:04:47 2004 +0000 @@ -62,22 +62,13 @@ tree_statement_list *list = static_cast<tree_statement_list *> (ptr); - unwind_protect::begin_frame ("do_catch_code"); - // Set up for letting the user print any messages from errors that // occurred in the body of the try_catch statement. - unwind_protect_bool (buffer_error_messages); - buffer_error_messages = false; - - bind_global_error_variable (); - - unwind_protect::add (clear_global_error_variable, 0); + buffer_error_messages--; if (list) list->eval (); - - unwind_protect::run_frame ("do_catch_code"); } void @@ -89,8 +80,8 @@ if (catch_code) { - unwind_protect_bool (buffer_error_messages); - buffer_error_messages = true; + unwind_protect_int (buffer_error_messages); + buffer_error_messages++; } unwind_protect::add (do_catch_code, catch_code); @@ -107,6 +98,9 @@ { error_state = 0; + // Unwind stack elements must be cleared or run in the reverse + // order in which they were added to the stack. + // For clearing the do_catch_code cleanup function. unwind_protect::discard ();