# New Ticket Created by "Alek Storm" # Please include the string: [perl #42074] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=42074 >
This patch defines a RECURSION_LIMIT macro in include/parrot/sub.h, which interp->recursion_limit is assigned to in src/inter_create.c. It's currently hardcoded as 1000 in inter_create.c. Thanks, Alek Storm
Index: include/parrot/sub.h =================================================================== --- include/parrot/sub.h (revision 17717) +++ include/parrot/sub.h (working copy) @@ -112,6 +112,12 @@ #define NEED_CONTINUATION ((void*)1) /* + * maximum sub recursion depth + */ + +#define RECURSION_LIMIT 1000 + +/* * Sub and Closure share a Parrot_sub structure. * Closures have additionally an 'outer_ctx' */ Index: src/inter_create.c =================================================================== --- src/inter_create.c (revision 17717) +++ src/inter_create.c (working copy) @@ -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. */