[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

[PATCH] fix debop with pad const



debop (-Dt) will fail with certain consts.
With ITHREADS, consts are stored in the pad, and the right pad
may not be active here, so check. Same check as in mad do_op_xmldump.

Porting/expand-macro.pl cSVOPo_sv =>
(((SVOP*)o)->op_sv ?
   ((SVOP*)o)->op_sv : ((my_perl->Icurpad)[(o)->op_targ]))

-- 
Reini Urban
http://phpwiki.org/  http://murbreak.at/
difforig perl-current/dump.c

diff -u perl-current/dump.c.orig perl-current/dump.c
--- perl-current/dump.c.orig	2008-04-06 20:15:26.000000000 +0000
+++ perl-current/dump.c	2008-06-24 10:00:44.484375000 +0000
@@ -2002,7 +2002,12 @@
     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:

Follow-Ups from:
"Rafael Garcia-Suarez" <rgarciasuarez@gmail.com>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]