diff options
author | Stephen McCamant <smcc@mit.edu> | 2001-01-15 09:14:37 -0800 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-01-16 01:49:07 +0000 |
commit | c03c28449e79a2a6287a0aa1cdd5d6637750d5c3 (patch) | |
tree | e687d3a31df0d9136c6d84e5c220189de02f447f /ext | |
parent | c155e47c72dddfc9198933377d5aa8edb497853c (diff) | |
download | perl-c03c28449e79a2a6287a0aa1cdd5d6637750d5c3.tar.gz |
Re: Eliminate op_children
Message-ID: <14947.40656.841280.551785@soda.csua.berkeley.edu>
Replace #8444 and #8445.
p4raw-id: //depot/perl@8448
Diffstat (limited to 'ext')
-rw-r--r-- | ext/B/B.xs | 12 | ||||
-rw-r--r-- | ext/B/B/Debug.pm | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/ext/B/B.xs b/ext/B/B.xs index 6b00e5ac1c..25d69e97bd 100644 --- a/ext/B/B.xs +++ b/ext/B/B.xs @@ -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 diff --git a/ext/B/B/Debug.pm b/ext/B/B/Debug.pm index 2ae1cd33f7..1327591e7f 100644 --- a/ext/B/B/Debug.pm +++ b/ext/B/B/Debug.pm @@ -42,7 +42,7 @@ sub B::LOGOP::debug { sub B::LISTOP::debug { my ($op) = @_; $op->B::BINOP::debug(); - printf "\top_last\t\t0x%x\n", ${$op->last}; + printf "\top_children\t%d\n", $op->children; } sub B::PMOP::debug { |