summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Pit <perl@profvince.com>2012-09-16 16:44:13 +0200
committerVincent Pit <perl@profvince.com>2012-09-16 16:44:13 +0200
commit72581b5b7341e76b3ea364b4d49c8340bb668228 (patch)
tree12ff0fb664f105cd31aa78951d000b93b4cd9b39
parent22ade07d6a4f442c7a3e970195597fd0cb266e0d (diff)
downloadperl-72581b5b7341e76b3ea364b4d49c8340bb668228.tar.gz
Fix perl with -DPERL_POISON after commit 22ade07
The third argument to PoisonNew is the type, not the size. Also, poisoning the contents of the sv itself is incorrect.
-rw-r--r--scope.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/scope.c b/scope.c
index 42e3af872c..eabdbd2f26 100644
--- a/scope.c
+++ b/scope.c
@@ -160,12 +160,9 @@ Perl_free_tmps(pTHX)
/* XXX should tmps_floor live in cxstack? */
const I32 myfloor = PL_tmps_floor;
while (PL_tmps_ix > myfloor) { /* clean up after last statement */
-#ifdef PERL_POISON
- SV* const sv = PL_tmps_stack[PL_tmps_ix];
- PoisonWith(sv, 1, sizeof(SV *), 0xAB);
- PL_tmps_ix--;
-#else
SV* const sv = PL_tmps_stack[PL_tmps_ix--];
+#ifdef PERL_POISON
+ PoisonWith(PL_tmps_stack + PL_tmps_ix + 1, 1, SV *, 0xAB);
#endif
if (sv && sv != &PL_sv_undef) {
SvTEMP_off(sv);