This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: Eliminate op_children
[perl5.git] / ext / B / B.xs
index 6b00e5a..25d69e9 100644 (file)
@@ -650,6 +650,18 @@ LOGOP_other(o)
 
 MODULE = B     PACKAGE = B::LISTOP             PREFIX = LISTOP_
 
+U32
+LISTOP_children(o)
+       B::LISTOP       o
+       OP *            kid = NO_INIT
+       int             i = NO_INIT
+    CODE:
+       ST(0) = sv_newmortal();
+       i = 0;
+       for (kid = o->op_first; kid; kid = kid->op_sibling)
+           i++;
+       sv_setiv(ST(0), i);
+
 #define PMOP_pmreplroot(o)     o->op_pmreplroot
 #define PMOP_pmreplstart(o)    o->op_pmreplstart
 #define PMOP_pmnext(o)         o->op_pmnext