This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
We cannot assert(sv) since sv can be validly null
authorJarkko Hietaniemi <jhi@iki.fi>
Thu, 29 May 2014 19:14:34 +0000 (15:14 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Thu, 29 May 2014 19:14:34 +0000 (15:14 -0400)
(see the top of the function), but we can test it.

dump.c

diff --git a/dump.c b/dump.c
index c2d72fd..5aaa82e 100644 (file)
--- a/dump.c
+++ b/dump.c
@@ -471,8 +471,7 @@ Perl_sv_peek(pTHX_ SV *sv)
   finish:
     while (unref--)
        sv_catpv(t, ")");
-    /* XXX when is sv ever NULL? */
-    if (TAINTING_get && SvTAINTED(sv))
+    if (TAINTING_get && sv && SvTAINTED(sv))
        sv_catpv(t, " [tainted]");
     return SvPV_nolen(t);
 }