[perl #32968] [PATCH] Re: B::walkoptree segfaults
Stephen McCamant [Tue, 28 Dec 2004 10:13:50 +0000 (02:13 -0800)]
Message-ID: <16849.41566.887352.677148@apocalypse.OCF.Berkeley.EDU>

p4raw-id: //depot/perl@23983

ext/B/B.xs
op.h

index 63f5a99..107d3a6 100644 (file)
@@ -408,10 +408,10 @@ walkoptree(pTHX_ SV *opsv, char *method)
            walkoptree(aTHX_ opsv, method);
        }
     }
-    if (o && (cc_opclass(aTHX_ o) == OPc_PMOP)
+    if (o && (cc_opclass(aTHX_ o) == OPc_PMOP) && o->op_type != OP_PUSHRE
            && (kid = cPMOPo->op_pmreplroot))
     {
-       sv_setiv(newSVrv(opsv, opclassnames[OPc_PMOP]), PTR2IV(kid));
+       sv_setiv(newSVrv(opsv, cc_opclassname(aTHX_ kid)), PTR2IV(kid));
        walkoptree(aTHX_ opsv, method);
     }
 }
diff --git a/op.h b/op.h
index 2e73168..ef093ef 100644 (file)
--- a/op.h
+++ b/op.h
@@ -267,7 +267,7 @@ struct pmop {
     BASEOP
     OP *       op_first;
     OP *       op_last;
-    OP *       op_pmreplroot;
+    OP *       op_pmreplroot; /* (type is really union {OP*,GV*,PADOFFSET}) */
     OP *       op_pmreplstart;
     PMOP *     op_pmnext;              /* list of all scanpats */
 #ifdef USE_ITHREADS