This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Don’t use PL_op without checking it first.
authorFather Chrysostomos <sprout@cpan.org>
Mon, 20 Sep 2010 07:44:15 +0000 (09:44 +0200)
committerRafael Garcia-Suarez <rgs@consttype.org>
Mon, 20 Sep 2010 07:44:15 +0000 (09:44 +0200)
doio.c

diff --git a/doio.c b/doio.c
index 2f660cc..526e1b5 100644 (file)
--- a/doio.c
+++ b/doio.c
@@ -1241,7 +1241,9 @@ Perl_do_print(pTHX_ register SV *sv, PerlIO *fp)
            else {
                assert((char *)result == tmps);
                Perl_ck_warner_d(aTHX_ packWARN(WARN_UTF8),
            else {
                assert((char *)result == tmps);
                Perl_ck_warner_d(aTHX_ packWARN(WARN_UTF8),
-                                "Wide character in %s", OP_DESC(PL_op));
+                                "Wide character in %s",
+                                  PL_op ? OP_DESC(PL_op) : "print"
+                               );
            }
        }
        /* To detect whether the process is about to overstep its
            }
        }
        /* To detect whether the process is about to overstep its