B::check_av() ; B::Deparse for CHECK blocks
[p5sagit/p5-mst-13.2.git] / ext / B / B.xs
index 885a73c..d7ae0f1 100644 (file)
@@ -365,7 +365,7 @@ void
 walkoptree(pTHX_ SV *opsv, char *method)
 {
     dSP;
-    OP *o;
+    OP *o, *kid;
     dMY_CXT;
 
     if (!SvROK(opsv))
@@ -383,13 +383,18 @@ walkoptree(pTHX_ SV *opsv, char *method)
     PUTBACK;
     perl_call_method(method, G_DISCARD);
     if (o && (o->op_flags & OPf_KIDS)) {
-       OP *kid;
        for (kid = ((UNOP*)o)->op_first; kid; kid = kid->op_sibling) {
            /* Use the same opsv. Rely on methods not to mess it up. */
            sv_setiv(newSVrv(opsv, cc_opclassname(aTHX_ kid)), PTR2IV(kid));
            walkoptree(aTHX_ opsv, method);
        }
     }
+    if (o && (cc_opclass(aTHX_ o) == OPc_PMOP)
+           && (kid = cPMOPo->op_pmreplroot))
+    {
+       sv_setiv(newSVrv(opsv, opclassnames[OPc_PMOP]), PTR2IV(kid));
+       walkoptree(aTHX_ opsv, method);
+    }
 }
 
 typedef OP     *B__OP;
@@ -441,6 +446,7 @@ BOOT:
 
 #define B_main_cv()    PL_main_cv
 #define B_init_av()    PL_initav
+#define B_check_av()   PL_checkav_save
 #define B_begin_av()   PL_beginav_save
 #define B_end_av()     PL_endav
 #define B_main_root()  PL_main_root
@@ -458,6 +464,9 @@ B::AV
 B_init_av()
 
 B::AV
+B_check_av()
+
+B::AV
 B_begin_av()
 
 B::AV
@@ -663,7 +672,7 @@ OP_ppaddr(o)
     CODE:
        sv_setpvn(sv, "PL_ppaddr[OP_", 13);
        sv_catpv(sv, PL_op_name[o->op_type]);
-       for (i=13; i<SvCUR(sv); ++i)
+       for (i=13; (STRLEN)i < SvCUR(sv); ++i)
            SvPVX(sv)[i] = toUPPER(SvPVX(sv)[i]);
        sv_catpv(sv, "]");
        ST(0) = sv;
@@ -781,11 +790,11 @@ PMOP_pmoffset(o)
 
 #endif
 
-U16
+U32
 PMOP_pmflags(o)
        B::PMOP         o
 
-U16
+U32
 PMOP_pmpermflags(o)
        B::PMOP         o