summaryrefslogtreecommitdiff
path: root/pod/perlvar.pod
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2019-03-17 22:11:04 -0600
committerKarl Williamson <khw@cpan.org>2019-03-17 22:17:29 -0600
commit6ef7fe531911e0b41ffcc04c1d6b6ec25a8b1bc9 (patch)
tree0fc833fa2bf0171a01f395300906e586a316485f /pod/perlvar.pod
parent3b89859ad83deaeff7c1ee7911d181ef10236879 (diff)
downloadperl-6ef7fe531911e0b41ffcc04c1d6b6ec25a8b1bc9.tar.gz
PATCH: [perl #131551] Too deep regex compilation recursion
This patch, started by Yves Orton, and refined in consultation with Tony Cook, imposes a maximum depth of unclosed left parentheses, at which point it croaks. This is to prevent the segfault in the ticket. The patch adds a variable that can be set to increase or decrease this limit at run time (actually regex compilation time) should this be desired, and hence our pre-determined limit of 1000 can be changed if necessary.
Diffstat (limited to 'pod/perlvar.pod')
-rw-r--r--pod/perlvar.pod11
1 files changed, 11 insertions, 0 deletions
diff --git a/pod/perlvar.pod b/pod/perlvar.pod
index d67d4cd8b1..b42cbe2251 100644
--- a/pod/perlvar.pod
+++ b/pod/perlvar.pod
@@ -1249,6 +1249,17 @@ regular expression assertion (see L<perlre>). May be written to.
This variable was added in Perl 5.005.
+=item ${^RE_COMPILE_RECURSION_LIMIT}
+X<${^RE_COMPILE_RECURSION_LIMIT}>
+
+The current value giving the maximum number of open but unclosed
+parenthetical groups there may be at any point during a regular
+expression compilation. The default is currently 1000 nested groups.
+You may adjust it depending on your needs and the amount of memory
+available.
+
+This variable was added in Perl v5.30.0.
+
=item ${^RE_DEBUG_FLAGS}
X<${^RE_DEBUG_FLAGS}>