This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #78550] Fix bad assertion in toke.c:start_subparse
authorFather Chrysostomos <sprout@cpan.org>
Sun, 5 Aug 2012 01:01:01 +0000 (18:01 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 5 Aug 2012 01:01:01 +0000 (18:01 -0700)
The outer ‘sub’ might actually be a format

t/comp/form_scope.t
toke.c

index 809e0d2..f10637f 100644 (file)
@@ -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.
diff --git a/toke.c b/toke.c
index 9deac94..9645ac6 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -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);