diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-08-04 18:01:01 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-08-04 18:01:01 -0700 |
commit | 9a7154347977e29a815d93c0097c5a9b660006b2 (patch) | |
tree | 7484a92de7ae014d98163326b4af3ee58f895bcb | |
parent | 5aec98dfc772975fdb511f380dee9d0b016c16be (diff) | |
download | perl-9a7154347977e29a815d93c0097c5a9b660006b2.tar.gz |
[perl #78550] Fix bad assertion in toke.c:start_subparse
The outer ‘sub’ might actually be a format
-rw-r--r-- | t/comp/form_scope.t | 6 | ||||
-rw-r--r-- | toke.c | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/t/comp/form_scope.t b/t/comp/form_scope.t index 809e0d2e72..f10637fd54 100644 --- a/t/comp/form_scope.t +++ b/t/comp/form_scope.t @@ -118,6 +118,12 @@ undef &x; print "ok 9 - closure var not available when outer sub is undefined\n"; } +format start_subparse::assertion = +@ +sub { } +. +# survived; no "print ok" necessary + # This is a variation of bug #22977, which crashes or fails an assertion # up to 5.16. # Keep this test last if you want test numbers to be sane. @@ -10742,9 +10742,6 @@ Perl_start_subparse(pTHX_ I32 is_format, U32 flags) const I32 oldsavestack_ix = PL_savestack_ix; CV* const outsidecv = PL_compcv; - if (PL_compcv) { - assert(SvTYPE(PL_compcv) == SVt_PVCV); - } SAVEI32(PL_subline); save_item(PL_subname); SAVESPTR(PL_compcv); |