summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-11-26 22:21:02 +0000
committerNicholas Clark <nick@ccl4.org>2006-11-26 22:21:02 +0000
commit23eab42ccdcdf01b414e4c1728d8f919b2705614 (patch)
tree5c97e4a5c50125c4362cc7fd8af226a264906601 /regcomp.c
parent0536c0a707b1bd3cc19a63305350f2cd34667109 (diff)
downloadperl-23eab42ccdcdf01b414e4c1728d8f919b2705614.tar.gz
Moving the reference count to the front of both _reg_trie_data and
_reg_ac_data allows smaller code in Perl_regdupe. p4raw-id: //depot/perl@29391
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/regcomp.c b/regcomp.c
index bfcbd6b5fe..5513a0a592 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -8714,6 +8714,13 @@ Perl_regdupe(pTHX_ const regexp *r, CLONE_PARAMS *param)
d->data[i] = (void*)OpREFCNT_inc((OP*)ri->data->data[i]);
OP_REFCNT_UNLOCK;
break;
+ case 'T':
+ /* Trie stclasses are readonly and can thus be shared
+ * without duplication. We free the stclass in pregfree
+ * when the corresponding reg_ac_data struct is freed.
+ */
+ reti->regstclass= ri->regstclass;
+ /* Fall through */
case 't':
OP_REFCNT_LOCK;
((reg_trie_data*)ri->data->data[i])->refcount++;
@@ -8722,17 +8729,6 @@ Perl_regdupe(pTHX_ const regexp *r, CLONE_PARAMS *param)
case 'n':
d->data[i] = ri->data->data[i];
break;
- case 'T':
- d->data[i] = ri->data->data[i];
- OP_REFCNT_LOCK;
- ((reg_ac_data*)d->data[i])->refcount++;
- OP_REFCNT_UNLOCK;
- /* Trie stclasses are readonly and can thus be shared
- * without duplication. We free the stclass in pregfree
- * when the corresponding reg_ac_data struct is freed.
- */
- reti->regstclass= ri->regstclass;
- break;
default:
Perl_croak(aTHX_ "panic: re_dup unknown data code '%c'", ri->data->what[i]);
}