This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
"goto must have label" message for C<goto ''>
authorJan Dubois <jand@activestate.com>
Sat, 13 Feb 1999 13:25:53 +0000 (14:25 +0100)
committerGurusamy Sarathy <gsar@cpan.org>
Sat, 13 Feb 1999 18:20:13 +0000 (18:20 +0000)
Message-Id: <36c9629c.13334874@smtp1.ibm.net>

p4raw-id: //depot/perl@2908

pod/perlfunc.pod
pp_ctl.c
t/lib/io_unix.t

index 435db65..1495514 100644 (file)
@@ -1005,6 +1005,8 @@ file.  Manual error checking can be done this way:
 
 =item dump LABEL
 
+=item dump
+
 This causes an immediate core dump.  Primarily this is so that you can
 use the B<undump> program to turn your core dump into an executable binary
 after having initialized all your variables at the beginning of the
index 405c344..2f66a5f 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2026,6 +2026,7 @@ PP(pp_goto)
     OP *enterops[GOTO_DEPTH];
     char *label;
     int do_dump = (PL_op->op_type == OP_DUMP);
+    static char must_have_label[] = "goto must have label";
 
     label = 0;
     if (PL_op->op_flags & OPf_STACKED) {
@@ -2279,12 +2280,15 @@ PP(pp_goto)
                RETURNOP(CvSTART(cv));
            }
        }
-       else
+       else {
            label = SvPV(sv,n_a);
+           if (!(do_dump || *label))
+               DIE(must_have_label);
+       }
     }
     else if (PL_op->op_flags & OPf_SPECIAL) {
        if (! do_dump)
-           DIE("goto must have label");
+           DIE(must_have_label);
     }
     else
        label = cPVOP->op_pv;
index ccb2748..30e7c0e 100644 (file)
@@ -10,6 +10,11 @@ BEGIN {
 use Config;
 
 BEGIN {
+    if (!$Config{d_fork}) {
+        print "1..0\n";
+        exit 0;
+    }
+
     if(-d "lib" && -f "TEST") {
         if ( ($Config{'extensions'} !~ /\bSocket\b/ ||
               $Config{'extensions'} !~ /\bIO\b/)    &&