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:
b37fc6e
)
op.c: Simplify expression.
author
Karl Williamson
<khw@cpan.org>
Sun, 27 Oct 2019 15:55:10 +0000
(09:55 -0600)
committer
Karl Williamson
<khw@cpan.org>
Thu, 7 Nov 2019 04:22:24 +0000
(21:22 -0700)
This also makes sure 'struct_size' has the correct value in it for any
future uses.
op.c
patch
|
blob
|
blame
|
history
diff --git
a/op.c
b/op.c
index
712b00d
..
e08b769
100644
(file)
--- a/
op.c
+++ b/
op.c
@@
-7097,9
+7097,8
@@
S_pmtrans(pTHX_ OP *o, OP *expr, OP *repl)
* store excess replacement chars at end of main table.
*/
- struct_size += excess;
- tbl = (OPtrans_map*)PerlMemShared_realloc(tbl,
- struct_size + excess * sizeof(short));
+ struct_size += excess * sizeof(short);
+ tbl = (OPtrans_map*)PerlMemShared_realloc(tbl, struct_size);
tbl->size += excess;
cPVOPo->op_pv = (char*)tbl;