diff options
author | Father Chrysostomos <sprout@cpan.org> | 2014-09-17 22:10:47 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2014-09-17 23:39:30 -0700 |
commit | 9bad585fd42ac7b91e4ae2831711c9148fe9fed1 (patch) | |
tree | 3bdf92ca688954863d3a1783176cf7d76163b0e2 /pp_hot.c | |
parent | 3b6e69b1b32e689d76dc3c485f17606b4a8d5a93 (diff) | |
download | perl-9bad585fd42ac7b91e4ae2831711c9148fe9fed1.tar.gz |
Remove !IS_PADGV assertions
Commit 60779a30f stopped setting PADTMP on GVs in pads,
and changed many instances of if(SvPADTMP && !IS_PADGV) to
if(SvPADTMP){assert(!IS_PADGV)...}.
This PADTMP was leftover from the original ithreads implementation
that marked these as PADTMP under the assumption that anything in a
pad had to be marked PADMY or PADTMP.
Since we don’t want these GVs copied the way operator targets are
(PADTMP indicates the latter), we needed this !IS_PADGV check all over
the place.
60779a30f was actually right in removing the flag and the !IS_PADGV
check, because it should be possible for XS modules to create ops that
return copiable GVs. But the assertions prevent that from working.
More importantly (to me at least), this IS_PADGV doesn’t quite make
sense and I am trying to eliminate it.
BTW, you have to be doubly naughty, but it is possible to fail these
assertions:
$ ./perl -Ilib -e 'BEGIN { sub { $::{foo} = \@_; constant::_make_const(@_) }->(*bar) } \ foo'
Assertion failed: (!IS_PADGV(sv)), function S_refto, file pp.c, line 576.
Abort trap: 6
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 4 |
1 files changed, 0 insertions, 4 deletions
@@ -1917,7 +1917,6 @@ PP(pp_iter) Perl_croak(aTHX_ "Use of freed value in iteration"); } if (SvPADTMP(sv)) { - assert(!IS_PADGV(sv)); sv = newSVsv(sv); } else { @@ -2435,7 +2434,6 @@ PP(pp_grepwhile) src = PL_stack_base[*PL_markstack_ptr]; if (SvPADTMP(src)) { - assert(!IS_PADGV(src)); src = PL_stack_base[*PL_markstack_ptr] = sv_mortalcopy(src); PL_tmps_floor++; } @@ -2697,7 +2695,6 @@ try_autoload: if (*MARK) { if (SvPADTMP(*MARK)) { - assert(!IS_PADGV(*MARK)); *MARK = sv_mortalcopy(*MARK); } SvTEMP_off(*MARK); @@ -2766,7 +2763,6 @@ try_autoload: while (items--) { mark++; if (*mark && SvPADTMP(*mark)) { - assert(!IS_PADGV(*mark)); *mark = sv_mortalcopy(*mark); } } |