@@ -4616,10 +4616,14 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
4616
4616
* parsing code, as each (?:..) is handled by a different invocation of
4617
4617
* reg() -- Yves
4618
4618
*/
4619
- if (PL_regkind[OP(scan)] == EXACT && OP(scan) != LEXACT
4620
- && OP(scan) != LEXACT_REQ8)
4619
+ if (PL_regkind[OP(scan)] == EXACT
4620
+ && OP(scan) != LEXACT
4621
+ && OP(scan) != LEXACT_REQ8
4622
+ && !frame
4623
+ ) {
4621
4624
join_exact(pRExC_state, scan, &min_subtract, &unfolded_multi_char,
4622
4625
0, NULL, depth + 1);
4626
+ }
4623
4627
4624
4628
/* Follow the next-chain of the current node and optimize
4625
4629
away all the NOTHINGs from it. */
@@ -5344,8 +5348,9 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
5344
5348
&& isALPHA_A(*s)
5345
5349
&& ( OP(scan) == EXACTFAA
5346
5350
|| ( OP(scan) == EXACTFU
5347
- && ! HAS_NONLATIN1_SIMPLE_FOLD_CLOSURE(*s))))
5348
- {
5351
+ && ! HAS_NONLATIN1_SIMPLE_FOLD_CLOSURE(*s)))
5352
+ && !frame
5353
+ ) {
5349
5354
U8 mask = ~ ('A' ^ 'a'); /* These differ in just one bit */
5350
5355
5351
5356
OP(scan) = ANYOFM;
@@ -5438,16 +5443,17 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
5438
5443
5439
5444
/* This temporary node can now be turned into EXACTFU, and
5440
5445
* must, as regexec.c doesn't handle it */
5441
- if (OP(next) == EXACTFU_S_EDGE) {
5446
+ if (OP(next) == EXACTFU_S_EDGE && !frame ) {
5442
5447
OP(next) = EXACTFU;
5443
5448
}
5444
5449
5445
5450
if ( STR_LEN(next) == 1
5446
5451
&& isALPHA_A(* STRING(next))
5447
5452
&& ( OP(next) == EXACTFAA
5448
5453
|| ( OP(next) == EXACTFU
5449
- && ! HAS_NONLATIN1_SIMPLE_FOLD_CLOSURE(* STRING(next)))))
5450
- {
5454
+ && ! HAS_NONLATIN1_SIMPLE_FOLD_CLOSURE(* STRING(next))))
5455
+ && !frame
5456
+ ) {
5451
5457
/* These differ in just one bit */
5452
5458
U8 mask = ~ ('A' ^ 'a');
5453
5459
@@ -5594,7 +5600,9 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
5594
5600
if ( OP(oscan) == CURLYX && data
5595
5601
&& data->flags & SF_IN_PAR
5596
5602
&& !(data->flags & SF_HAS_EVAL)
5597
- && !deltanext && minnext == 1 ) {
5603
+ && !deltanext && minnext == 1
5604
+ && !frame
5605
+ ) {
5598
5606
/* Try to optimize to CURLYN. */
5599
5607
regnode *nxt = NEXTOPER(oscan) + EXTRA_STEP_2ARGS;
5600
5608
regnode * const nxt1 = nxt;
@@ -5644,10 +5652,10 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
5644
5652
&& !(data->flags & SF_HAS_EVAL)
5645
5653
&& !deltanext /* atom is fixed width */
5646
5654
&& minnext != 0 /* CURLYM can't handle zero width */
5647
-
5648
5655
/* Nor characters whose fold at run-time may be
5649
5656
* multi-character */
5650
5657
&& ! (RExC_seen & REG_UNFOLDED_MULTI_SEEN)
5658
+ && !frame
5651
5659
) {
5652
5660
/* XXXX How to optimize if data == 0? */
5653
5661
/* Optimize to a simpler form. */
0 commit comments