This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[gh18096] assume worst-case for GOSUBs we don't analyse
authorHugo van der Sanden <hv@crypt.org>
Tue, 15 Sep 2020 13:02:54 +0000 (14:02 +0100)
committerHugo van der Sanden <hv@crypt.org>
Tue, 22 Sep 2020 11:51:47 +0000 (12:51 +0100)
commitf4cd5e29bc15621f2ab8fc5d7de0e68e62d43999
tree4fb9ff055138e7e0431c6916e9fcfc7cdd071116
parentbec07c3af574f0f22a318c6273a2c4f29afc1251
[gh18096] assume worst-case for GOSUBs we don't analyse

During study_chunk, under various conditions we avoid recursing into
a GOSUB. But we must avoid giving the enclosing scope the idea that
this GOSUB would match only an empty string, since that could trigger
wrong optimizations (eg CURLYX => CURLYM in the ticket).

So we mark the construct as infinite, as in the code branch where we
_do_ recurse into it.
regcomp.c
t/re/re_tests