X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FLexical-Types.git;a=blobdiff_plain;f=Types.xs;h=0cff8fa6e90a930d94f37208b13c9859c4cd1742;hp=02e5da71947dad06be2ab3c875f8eca5e2550949;hb=881d1aecb5e9948bbd7a384deffbab560eab4ef4;hpb=967fca89c944c8d7560c0d94d1982455bc62854d diff --git a/Types.xs b/Types.xs index 02e5da7..0cff8fa 100644 --- a/Types.xs +++ b/Types.xs @@ -687,7 +687,9 @@ STATIC OP *lt_pp_padrange(pTHX) { base = PL_op->op_targ; count = PL_op->op_private & OPpPADRANGE_COUNTMASK; - for (i = 0, p = roi.padxv_start; i < count && p; ++i, p = OP_SIBLING(p)) { + for (i = 0, p = roi.padxv_start; i < count && p; ++i, p = p->op_next) { + while (p->op_type == OP_NULL) + p = p->op_next; lt_op_padxv_info oi; if (p->op_type == OP_PADSV && lt_padxv_map_fetch(p, &oi)) lt_op_padxv_info_call(&oi, PAD_SV(base + i)); @@ -806,7 +808,7 @@ STATIC int lt_maybe_padrange_setup(pTHX_ OP *o, const OP *start) { count = o->op_private & OPpPADRANGE_COUNTMASK; - for (i = 0, p = start; i < count && p; ++i, p = OP_SIBLING(p)) { + for (i = 0, p = start; i < count && p; ++i, p = p->op_next) { if (p->op_type == OP_PADSV) { /* In a padrange sequence, either all lexicals are typed, or none are. * Thus we can stop at the first padsv op. However, note that these @@ -858,8 +860,15 @@ STATIC void lt_peep_rec(pTHX_ OP *o, ptable *seen) { && !(o->op_flags & OPf_SPECIAL)) { /* A padrange op is guaranteed to have previously been a pushmark. * Moreover, for non-special padrange ops (i.e. that aren't for - * my (...) = @_), the original padxv ops are its siblings. */ - lt_maybe_padrange_setup(o, OP_SIBLING(o)); + * my (...) = @_), the first original padxv is its sibling or nephew. + */ + OP *kid = OP_SIBLING(o); + if (kid->op_type == OP_NULL && kid->op_flags & OPf_KIDS) { + kid = kUNOP->op_first; + if (kid->op_type == OP_NULL) + kid = OP_SIBLING(kid); + } + lt_maybe_padrange_setup(o, kid); } break; case OP_AASSIGN: {