Fix assertion failure with -DT -e\"
authorFather Chrysostomos <sprout@cpan.org>
Mon, 9 Sep 2013 01:51:56 +0000 (18:51 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Mon, 9 Sep 2013 07:52:07 +0000 (00:52 -0700)
$ ./perl -DT -e\"
Assertion failed: (s), function S_printbuf, file toke.c, line 479.
Abort trap: 6

toke.c

diff --git a/toke.c b/toke.c
index 54403b0..e738311 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -6835,7 +6835,13 @@ Perl_yylex(pTHX)
 
     case '"':
        s = scan_str(s,!!PL_madskills,FALSE,FALSE, FALSE);
-       DEBUG_T( { printbuf("### Saw string before %s\n", s); } );
+       DEBUG_T( {
+           if (s)
+               printbuf("### Saw string before %s\n", s);
+           else
+               PerlIO_printf(Perl_debug_log,
+                            "### Saw unterminated string\n");
+       } );
        if (PL_expect == XOPERATOR) {
            if (PL_lex_formbrack && PL_lex_brackets == PL_lex_formbrack) {
                return deprecate_commaless_var_list();