This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3ec35e0
)
Strength reduction optimisation seems to spot that a = a + 1; is just
author
Nicholas Clark
<nick@ccl4.org>
Mon, 9 Jun 2008 18:43:59 +0000
(18:43 +0000)
committer
Nicholas Clark
<nick@ccl4.org>
Mon, 9 Jun 2008 18:43:59 +0000
(18:43 +0000)
a++; so write it as the former, to keep PERL_DEBUG_COW happy.
p4raw-id: //depot/perl@34039
regcomp.c
patch
|
blob
|
blame
|
history
diff --git
a/regcomp.c
b/regcomp.c
index
6a77d55
..
73fce85
100644
(file)
--- a/
regcomp.c
+++ b/
regcomp.c
@@
-5669,11
+5669,7
@@
S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp,U32 depth)
pv = (I32*)SvGROW(sv_dat, SvCUR(sv_dat) + sizeof(I32)+1);
SvCUR_set(sv_dat, SvCUR(sv_dat) + sizeof(I32));
pv[count] = RExC_npar;
-#ifdef PERL_DEBUG_COW
- ((XPVIV*) SvANY(sv_dat))->xiv_iv++;
-#else
- SvIVX(sv_dat)++;
-#endif
+ SvIV_set(sv_dat, SvIVX(sv_dat) + 1);
}
} else {
(void)SvUPGRADE(sv_dat,SVt_PVNV);