summaryrefslogtreecommitdiff
path: root/scope.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-05-19 00:28:51 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-05-19 00:28:51 +0000
commitb10ca0cce1ca86335578f2703c4e53f128db6107 (patch)
tree698244d2acf57eb8a374213afbc7d3b728b26182 /scope.c
parent34952ae2e304c87beb5cdcf1d36d996f01beb640 (diff)
downloadperl-b10ca0cce1ca86335578f2703c4e53f128db6107.tar.gz
Sarathy pointed out that instead of zeroing heap
it is more prudent to poison it. p4raw-id: //depot/perl@16688
Diffstat (limited to 'scope.c')
-rw-r--r--scope.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/scope.c b/scope.c
index 5ae9a31a9a..673b64cf8b 100644
--- a/scope.c
+++ b/scope.c
@@ -80,9 +80,10 @@ Perl_new_stackinfo(pTHX_ I32 stitems, I32 cxitems)
si->si_cxmax = cxitems - 1;
si->si_cxix = -1;
si->si_type = PERLSI_UNDEF;
- /* Needs to be Newz() instead of New() because PUSHSUBST()
- * in pp_subst() might otherwise read uninitialized heap. */
- Newz(56, si->si_cxstack, cxitems, PERL_CONTEXT);
+ New(56, si->si_cxstack, cxitems, PERL_CONTEXT);
+ /* Without any kind of initialising PUSHSUBST()
+ * in pp_subst() will read uninitialised heap. */
+ Poison(si->si_cxstack, cxitems, PERL_CONTEXT);
return si;
}
@@ -92,10 +93,9 @@ Perl_cxinc(pTHX)
IV old_max = cxstack_max;
cxstack_max = GROW(cxstack_max);
Renew(cxstack, cxstack_max + 1, PERL_CONTEXT); /* XXX should fix CXINC macro */
- /* Needs to Zero()ed because otherwise deep enough recursion
- * (such as in lib/Math/BigInt/t/upgrade.t) will end up reading
- * uninitialized heap. */
- Zero(cxstack + old_max + 1, cxstack_max - old_max, PERL_CONTEXT);
+ /* Without any kind of initialising deep enough recursion
+ * will end up reading uninitialised PERL_CONTEXTs. */
+ Poison(cxstack + old_max + 1, cxstack_max - old_max, PERL_CONTEXT);
return cxstack_ix + 1;
}