This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Integrate:
authorNicholas Clark <nick@ccl4.org>
Sat, 17 Sep 2005 15:34:45 +0000 (15:34 +0000)
committerNicholas Clark <nick@ccl4.org>
Sat, 17 Sep 2005 15:34:45 +0000 (15:34 +0000)
[ 23336]
Perl -DT segfaults when parsing a 'use' statement

[ 23339]
the improved -DT output of #23325 could print an uninit stack value
p4raw-link: @23339 on //depot/perl: 3afc138ae8d937f9bbca45350859ec2c8429f730
p4raw-link: @23336 on //depot/perl: 401441c0a1ebb6ac9c38237eb5daa1c00cea8bb6

p4raw-id: //depot/maint-5.8/perl@25435
p4raw-integrated: from //depot/perl@23339 'edit in' toke.c (@23336..)

toke.c

diff --git a/toke.c b/toke.c
index 96d9a27..03f9c76 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -316,8 +316,11 @@ S_tokereport(pTHX_ const 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));
@@ -2322,7 +2325,7 @@ Perl_yylex_r(pTHX_ YYSTYPE *lvalp, int *lcharp)
 int
 Perl_yylex(pTHX)
 {
-    register char *s;
+    register char *s = PL_bufptr;
     register char *d;
     register I32 tmp;
     STRLEN len;