From: Stephen McCamant Date: Tue, 28 Dec 2004 10:13:50 +0000 (-0800) Subject: [perl #32968] [PATCH] Re: B::walkoptree segfaults X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5464c1495ed0e2dec7738478e7bb89ce97a68c52;p=p5sagit%2Fp5-mst-13.2.git [perl #32968] [PATCH] Re: B::walkoptree segfaults Message-ID: <16849.41566.887352.677148@apocalypse.OCF.Berkeley.EDU> p4raw-id: //depot/perl@23983 --- diff --git a/ext/B/B.xs b/ext/B/B.xs index 63f5a99..107d3a6 100644 --- a/ext/B/B.xs +++ b/ext/B/B.xs @@ -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 --- 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