diff src/ov-usr-fcn.cc @ 10637:9cd5aa83fa62

implement 'local' parameter to pseudo-variables
author Jaroslav Hajek <highegg@gmail.com>
date Mon, 17 May 2010 13:46:57 +0200
parents cb0883127251
children 1b2fcd122c6a
line wrap: on
line diff
--- a/src/ov-usr-fcn.cc	Mon May 17 11:52:59 2010 +0200
+++ b/src/ov-usr-fcn.cc	Mon May 17 13:46:57 2010 +0200
@@ -182,7 +182,8 @@
     num_named_args (param_list ? param_list->length () : 0),
     nested_function (false), inline_function (false),
     class_constructor (false), class_method (false),
-    parent_scope (-1), local_scope (sid)
+    parent_scope (-1), local_scope (sid),
+    curr_unwind_protect_frame (0)
 {
   if (cmd_list)
     cmd_list->mark_as_function_body ();
@@ -398,6 +399,12 @@
   if (echo_commands)
     print_code_function_header ();
 
+  // Set pointer to the current unwind_protect frame to allow
+  // certain builtins register simple cleanup in a very optimized manner.
+  // This is *not* intended as a general-purpose on-cleanup mechanism,
+  frame.protect_var (curr_unwind_protect_frame);
+  curr_unwind_protect_frame = &frame;
+
   // Evaluate the commands that make up the function.
 
   frame.protect_var (tree_evaluator::in_fcn_or_script_body);