summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorHugo van der Sanden <hv@crypt.org>2017-02-28 11:23:09 +0000
committerDavid Mitchell <davem@iabyn.com>2017-03-15 09:17:08 +0000
commit00195859c65eccf9425faf45db543a12c7ad3874 (patch)
treecd04c70326c16ed06553a6608564bd8237b888b6 /pp_hot.c
parentacfc2cc32784cce84bd781bc3822b14406b94db2 (diff)
downloadperl-00195859c65eccf9425faf45db543a12c7ad3874.tar.gz
update size after Renew
RT #130841 In general code, change this idiom: PL_foo_max += size; Renew(PL_foo, PL_foo_max, foo_t); to Renew(PL_foo, PL_foo_max + size, foo_t); PL_foo_max += size; so that if Renew dies, PL_foo_max won't be left hanging.
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 58bbe2f1e9..4f0d094ce6 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -4134,8 +4134,8 @@ PP(pp_entersub)
items = SP - MARK;
if (UNLIKELY(items - 1 > AvMAX(av))) {
SV **ary = AvALLOC(av);
- AvMAX(av) = items - 1;
Renew(ary, items, SV*);
+ AvMAX(av) = items - 1;
AvALLOC(av) = ary;
AvARRAY(av) = ary;
}