Perl -DT segfaults when parsing a 'use' statement
Rafael Garcia-Suarez [Tue, 28 Sep 2004 08:08:24 +0000 (08:08 +0000)]
p4raw-id: //depot/perl@23336

toke.c

diff --git a/toke.c b/toke.c
index 4e1aa8e..91545e4 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -309,8 +309,11 @@ S_tokereport(pTHX_ char* s, I32 rv)
            Perl_sv_catpvf(aTHX_ report, "(pval=\"%s\")", yylval.pval);
            break;
        case TOKENTYPE_OPVAL:
-           Perl_sv_catpvf(aTHX_ report, "(opval=op_%s)",
+           if (yylval.opval)
+               Perl_sv_catpvf(aTHX_ report, "(opval=op_%s)",
                                    PL_op_name[yylval.opval->op_type]);
+           else
+               Perl_sv_catpv(aTHX_ report, "(opval=null)");
            break;
        }
         Perl_sv_catpvf(aTHX_ report, " at line %d [", CopLINE(PL_curcop));