summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2020-04-04 21:10:58 -0600
committerKarl Williamson <khw@cpan.org>2020-04-05 06:14:44 -0600
commit99d2ace527b7c674a6e6c604deb0fa2522cac990 (patch)
tree2c95a11d84666991bb01b206f9fbcb56d39f85f2 /regcomp.c
parent8f7b57e5771a5954483812f1c0cc87802c04e81f (diff)
downloadperl-99d2ace527b7c674a6e6c604deb0fa2522cac990.tar.gz
regcomp.c: Rmv unnecessary code
As spotted by Hugo van der Sanden, a barckwards reference to a capturing group doesn't need to look forward instead. If we don't have a capturing group we already should have, looking forward won't magically produce it.
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/regcomp.c b/regcomp.c
index c2ab7b8d28..0e1103c7f9 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -11729,16 +11729,8 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp, U32 depth)
num = RExC_npar + num;
if (num < 1) {
- /* It might be a forward reference; we can't fail until
- * we know, by completing the parse to get all the
- * groups, and then reparsing */
- if (ALL_PARENS_COUNTED) {
- RExC_parse++;
+ RExC_parse++;
vFAIL(non_existent_group_msg);
- }
- else {
- REQUIRE_PARENS_PASS;
- }
}
} else if ( paren == '+' ) {
num = RExC_npar + num - 1;