Author: paultcochrane
Date: Fri Mar 30 13:20:34 2007
New Revision: 17863

Modified:
   trunk/include/parrot/sub.h
   trunk/src/inter_create.c

Log:
Defining a RECURSION_LIMIT macro instead of using a hardcoded value.  Patch
courtesy of Alek Storm <alek dot storm at gmail dot com>


Modified: trunk/include/parrot/sub.h
==============================================================================
--- trunk/include/parrot/sub.h  (original)
+++ trunk/include/parrot/sub.h  Fri Mar 30 13:20:34 2007
@@ -111,6 +111,12 @@
 #define NEED_CONTINUATION ((PMC *)1)
 
 /*
+ * maximum sub recursion depth
+ */
+
+#define RECURSION_LIMIT 1000
+
+/*
  * Sub and Closure share a Parrot_sub structure.
  * Closures have additionally an 'outer_ctx'
  */

Modified: trunk/src/inter_create.c
==============================================================================
--- trunk/src/inter_create.c    (original)
+++ trunk/src/inter_create.c    Fri Mar 30 13:20:34 2007
@@ -123,7 +123,7 @@
     interp->resume_flag = RESUME_INITIAL;
     /* main is called as a Sub too - this will get depth 0 then */
     CONTEXT(interp->ctx)->recursion_depth = -1;
-    interp->recursion_limit = 1000;
+    interp->recursion_limit = RECURSION_LIMIT;
 
     /* Must initialize flags here so the GC_DEBUG stuff is available before
      * mem_setup_allocator() is called. */

Reply via email to