This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
S_regatom: reinitialize flags if reparsing
authorKarl Williamson <khw@cpan.org>
Thu, 14 Nov 2019 20:46:53 +0000 (13:46 -0700)
committerKarl Williamson <khw@cpan.org>
Sat, 16 Nov 2019 17:49:19 +0000 (10:49 -0700)
Sometimes we have to reparse a node.  We need to reset the flags to
avoid contamination from the first parse, where a flag got set by a
character in it that won't actually be in the reparsed version.

regcomp.c

index 78ccce1..6ce4996 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -13858,6 +13858,13 @@ S_regatom(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
             p = RExC_parse;
             len = 0;
             s = s0;
+            node_type = EXACT;
+            oldp = NULL;
+            maybe_exactfu = FOLD && (DEPENDS_SEMANTICS || LOC);
+            maybe_SIMPLE = SIMPLE;
+            requires_utf8_target = FALSE;
+            has_ss = FALSE;
+            has_micro_sign = FALSE;
 
           continue_parse: