From: Chad Granum Date: Tue, 11 May 2010 06:12:21 +0000 (-0700) Subject: Applied patch from Zefram in rt #55384 X-Git-Tag: 0.001003~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5df2f925a4e50e355b843d1c4bd8491454120d29;p=p5sagit%2FDevel-BeginLift.git Applied patch from Zefram in rt #55384 Version bump --- diff --git a/BeginLift.xs b/BeginLift.xs index 9794747..ebf9279 100644 --- a/BeginLift.xs +++ b/BeginLift.xs @@ -12,6 +12,33 @@ #define LINKLIST(o) ((o)->op_next ? (o)->op_next : linklist((OP*)o)) +#ifndef linklist +# define linklist(o) THX_linklist(aTHX_ o) +STATIC OP *THX_linklist(pTHX_ OP *o) { + OP *first; + if(o->op_next) + return o->op_next; + first = cUNOPo->op_first; + if (first) { + OP *kid; + o->op_next = LINKLIST(first); + kid = first; + for (;;) { + if (kid->op_sibling) { + kid->op_next = LINKLIST(kid->op_sibling); + kid = kid->op_sibling; + } else { + kid->op_next = o; + break; + } + } + } else { + o->op_next = o; + } + return o->op_next; +} +#endif /* !linklist */ + STATIC OP *lift_cb(pTHX_ OP *o, CV *cv, void *user_data) { dSP; SV *sv; diff --git a/lib/Devel/BeginLift.pm b/lib/Devel/BeginLift.pm index 90f6a4a..541b4fd 100644 --- a/lib/Devel/BeginLift.pm +++ b/lib/Devel/BeginLift.pm @@ -4,7 +4,7 @@ use strict; use warnings; use 5.008001; -our $VERSION = 0.001002; +our $VERSION = 0.001003; use vars qw(%lift); use base qw(DynaLoader);