diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2008-01-11 11:31:34 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2008-01-11 11:31:34 +0000 |
commit | ccb2c8b8ab146edc148e377cd6b108da77d1320b (patch) | |
tree | b58534185023feabf06d12fe6445ce3fbc9ebbdb | |
parent | 52b4506763c1e322f848f17908bebdf7672f168e (diff) | |
download | perl-ccb2c8b8ab146edc148e377cd6b108da77d1320b.tar.gz |
Introduce macro PERL_MAX_SUB_DEPTH
p4raw-id: //depot/perl@32949
-rw-r--r-- | perl.h | 5 | ||||
-rw-r--r-- | pp_ctl.c | 2 | ||||
-rw-r--r-- | pp_hot.c | 2 |
3 files changed, 7 insertions, 2 deletions
@@ -919,6 +919,11 @@ EXTERN_C int usleep(unsigned int); #define PERL_ARENA_SIZE 4080 #endif +/* Maximum level of recursion */ +#ifndef PERL_MAX_SUB_DEPTH +#define PERL_MAX_SUB_DEPTH 100 +#endif + #endif /* PERL_CORE */ /* We no longer default to creating a new SV for GvSV. @@ -2427,7 +2427,7 @@ PP(pp_goto) if (CvDEPTH(cv) < 2) SvREFCNT_inc_simple_void_NN(cv); else { - if (CvDEPTH(cv) == 100 && ckWARN(WARN_RECURSION)) + if (CvDEPTH(cv) == PERL_MAX_SUB_DEPTH && ckWARN(WARN_RECURSION)) sub_crush_depth(cv); pad_push(padlist, CvDEPTH(cv)); } @@ -2830,7 +2830,7 @@ try_autoload: * stuff so that __WARN__ handlers can safely dounwind() * if they want to */ - if (CvDEPTH(cv) == 100 && ckWARN(WARN_RECURSION) + if (CvDEPTH(cv) == PERL_MAX_SUB_DEPTH && ckWARN(WARN_RECURSION) && !(PERLDB_SUB && cv == GvCV(PL_DBsub))) sub_crush_depth(cv); #if 0 |