This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix potential null deref introduced by change #27716
[perl5.git] / perly.c
diff --git a/perly.c b/perly.c
index c494156..18f8606 100644 (file)
--- a/perly.c
+++ b/perly.c
@@ -296,6 +296,11 @@ Perl_yyparse (pTHX)
          rule.  */
     int yylen;
 
+#ifdef PERL_MAD
+    if (PL_madskills)
+       return madparse();
+#endif
+
     YYDPRINTF ((Perl_debug_log, "Starting parse\n"));
 
     ENTER;                     /* force stack free before we return */
@@ -403,7 +408,11 @@ Perl_yyparse (pTHX)
     /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
     if (yychar == YYEMPTY) {
        YYDPRINTF ((Perl_debug_log, "Reading a token: "));
+#ifdef PERL_MAD
+       yychar = PL_madskills ? madlex() : yylex();
+#else
        yychar = yylex();
+#endif
 #  ifdef EBCDIC
        if (yychar >= 0 && yychar < 255) {
            yychar = NATIVE_TO_ASCII(yychar);