diff options
author | Karl Williamson <khw@cpan.org> | 2018-10-16 12:16:10 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2018-10-20 00:09:56 -0600 |
commit | 690dd6eba70d6a431cbb661b449c25d4d4e0a029 (patch) | |
tree | 1789eb66316fbae5137893d36c995aaa7146f6d8 | |
parent | ded2bbcb0033e7d291e5297d88e54ead574b1f0e (diff) | |
download | perl-690dd6eba70d6a431cbb661b449c25d4d4e0a029.tar.gz |
regcomp.c: Move fcn call out of loop
The loop in this case is by a goto label, and the function determines if
there are runtime code blocks in the pattern. That doesn't change if we
have to reparse, so the return from the function doesn't change, so we
only have to call it once.
-rw-r--r-- | regcomp.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -7175,7 +7175,6 @@ Perl_re_op_compile(pTHX_ SV ** const patternp, int pat_count, PL_colors[4], PL_colors[5], s); }); - redo_parse: /* we jump here if we have to recompile, e.g., from upgrading the pattern * to utf8 */ @@ -7186,6 +7185,7 @@ Perl_re_op_compile(pTHX_ SV ** const patternp, int pat_count, ) runtime_code = S_has_runtime_code(aTHX_ pRExC_state, exp, plen); + redo_parse: /* return old regex if pattern hasn't changed */ /* XXX: note in the below we have to check the flags as well as the * pattern. @@ -7346,7 +7346,7 @@ Perl_re_op_compile(pTHX_ SV ** const patternp, int pat_count, /* Allocate space and zero-initialize. Note, the two step process of zeroing when in debug mode, thus anything assigned has to happen after that */ - Rx = (REGEXP*) newSV_type(SVt_REGEXP); + RExC_rx_sv = Rx = (REGEXP*) newSV_type(SVt_REGEXP); r = ReANY(Rx); Newxc(RExC_rxi, sizeof(regexp_internal) + (unsigned)RExC_size * sizeof(regnode), char, regexp_internal); |