develooper Front page | perl.perl5.porters | Postings from January 2001

[PATCH #3 @8436] Re: Eliminate op_children

Thread Previous | Thread Next
From:
Stephen McCamant
Date:
January 15, 2001 17:14
Subject:
[PATCH #3 @8436] Re: Eliminate op_children
Message ID:
14947.40656.841280.551785@soda.csua.berkeley.edu
>>>>> "JHi" == Jarkko Hietaniemi <jhi@iki.fi> writes:

>> >>>>> "SMcC" == Stephen McCamant <smcc@CSUA.Berkeley.EDU> writes:
SMcC> This a finished version of a change I started working quite a
SMcC> while ago -- getting rid of the op_children field in

JHi> On Sun, Jan 14, 2001 at 03:23:56AM -0800, Stephen McCamant wrote:
SMcC> I guess I shouldn't be patching this late at night -- I forgot the
SMcC> changes to B::C, appended.

JHi> B.xs.

Uh, yeah. This one I had already written (and I even alluded it in the
text of my first message), I just forgot it while making the patch.
This should fix B::Debug (as well as any other random B:: modules that 
look at $op->children, which is more important).

 -- Stephen McC

--- ext/B/B.xs.orig	Sat Jan 13 16:21:01 2001
+++ ext/B/B.xs	Sun Jan 14 01:46:51 2001
@@ -648,13 +648,19 @@
 LOGOP_other(o)
 	B::LOGOP	o
 
-#define LISTOP_children(o)	o->op_children
-
 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

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About