fix debop with pad const
Reini Urban [Tue, 24 Jun 2008 12:07:01 +0000 (14:07 +0200)]
Message-ID: <4860C745.2020307@x-ray.at>

p4raw-id: //depot/perl@34085

dump.c

diff --git a/dump.c b/dump.c
index 29fb489..c556cec 100644 (file)
--- a/dump.c
+++ b/dump.c
@@ -2002,7 +2002,12 @@ Perl_debop(pTHX_ const OP *o)
     switch (o->op_type) {
     case OP_CONST:
     case OP_HINTSEVAL:
-       PerlIO_printf(Perl_debug_log, "(%s)", SvPEEK(cSVOPo_sv));
+       /* with ITHREADS, consts are stored in the pad, and the right pad
+        * may not be active here, so check.
+        * (((SVOP*)o)->op_sv ? ((SVOP*)o)->op_sv : ((my_perl->Icurpad)[(o)->op_targ])) 
+        */
+       if (((SVOP*)o)->op_sv)
+           PerlIO_printf(Perl_debug_log, "(%s)", SvPEEK(cSVOPo_sv));
        break;
     case OP_GVSV:
     case OP_GV: