X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=indirect.xs;h=aa2e69198efcc9caf25dabb40ad9f88ef969a3d2;hb=7ded1e91a0a0ddc3e709cda9573fe0e53a32e092;hp=2d02563f3fe1f437801d0a3887a699a2d05ee3ab;hpb=b78d08a728ad517a03a0b7302f45201964654488;p=perl%2Fmodules%2Findirect.git diff --git a/indirect.xs b/indirect.xs index 2d02563..aa2e691 100644 --- a/indirect.xs +++ b/indirect.xs @@ -192,13 +192,15 @@ STATIC OP *indirect_ck_entersub(pTHX_ OP *o) { if (hint) { const char *pm, *po; SV *svm, *svo; - op = (LISTOP *) o; - while (op->op_type != OP_PUSHMARK) - op = (LISTOP *) op->op_first; - oo = op->op_sibling; - om = oo; - while (om->op_sibling) - om = om->op_sibling; + oo = o; + do { + op = (LISTOP *) oo; + if (!op->op_flags & OPf_KIDS) + goto done; + oo = op->op_first; + } while (oo->op_type != OP_PUSHMARK); + oo = oo->op_sibling; + om = op->op_last; if (om->op_type == OP_METHOD) om = cUNOPx(om)->op_first; else if (om->op_type != OP_METHOD_NAMED)