Remove ‘bad top format’ error
authorFather Chrysostomos <sprout@cpan.org>
Mon, 10 Jun 2013 00:30:56 +0000 (17:30 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Mon, 10 Jun 2013 00:30:56 +0000 (17:30 -0700)
This is unreachable.  It only happens in pp_leavewrite when IoTOP_GV(io)
is null, but the code leading up to it makes sure that IoTOP_GV(io) is not
null.  If it is still null, it jumps past the error with ‘goto forget_top’.

pp_sys.c
t/porting/diag.t

index b5efeb4..a6603ce 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -1470,8 +1470,7 @@ PP(pp_leavewrite)
        PL_formtarget = PL_toptarget;
        IoFLAGS(io) |= IOf_DIDTOP;
        fgv = IoTOP_GV(io);
-       if (!fgv)
-           DIE(aTHX_ "bad top format reference");
+       assert(fgv); /* IoTOP_GV(io) should have been set above */
        cv = GvFORM(fgv);
        if (!cv) {
            SV * const sv = sv_newmortal();
index ebf9b48..51936fd 100644 (file)
@@ -457,7 +457,6 @@ sub check_message {
 __DATA__
 Malformed UTF-8 character (unexpected non-continuation byte 0x%x, immediately after start byte 0x%x)
 
-bad top format reference
 Cannot apply "%s" in non-PerlIO perl
 Can't %s big-endian %ss on this
 Can't call mro_isa_changed_in() on anonymous symbol table