diff src/ov-usr-fcn.cc @ 10578:cb0883127251

limit on recursion via calls to source function
author John W. Eaton <jwe@octave.org>
date Tue, 27 Apr 2010 12:07:04 -0400
parents 57a59eae83cc
children 9cd5aa83fa62
line wrap: on
line diff
--- a/src/ov-usr-fcn.cc	Tue Apr 27 00:52:28 2010 -0400
+++ b/src/ov-usr-fcn.cc	Tue Apr 27 12:07:04 2010 -0400
@@ -49,9 +49,6 @@
 #include "parse.h"
 #include "variables.h"
 
-// Maximum nesting level for functions called recursively.
-static int Vmax_recursion_depth = 256;
-
 // Whether to optimize subsasgn method calls.
 static bool Voptimize_subsasgn_calls = true;
 
@@ -146,7 +143,7 @@
                     octave_call_stack::backtrace_error_message ();
                 }
               else
-                ::error ("max_recursion_limit exceeded");
+                ::error ("max_recursion_depth exceeded");
             }
         }
       else
@@ -339,7 +336,7 @@
 
   if (call_depth >= Vmax_recursion_depth)
     {
-      ::error ("max_recursion_limit exceeded");
+      ::error ("max_recursion_depth exceeded");
       return retval;
     }
 
@@ -668,18 +665,6 @@
   return retval;
 }
 
-DEFUN (max_recursion_depth, args, nargout,
-  "-*- texinfo -*-\n\
-@deftypefn {Built-in Function} {@var{val} =} max_recursion_depth ()\n\
-@deftypefnx {Built-in Function} {@var{old_val} =} max_recursion_depth (@var{new_val})\n\
-Query or set the internal limit on the number of times a function may\n\
-be called recursively.  If the limit is exceeded, an error message is\n\
-printed and control returns to the top level.\n\
-@end deftypefn")
-{
-  return SET_INTERNAL_VARIABLE (max_recursion_depth);
-}
-
 DEFUN (optimize_subsasgn_calls, args, nargout,
   "-*- texinfo -*-\n\
 @deftypefn {Built-in Function} {@var{val} =} optimize_subsasgn_calls ()\n\