On Tue, May 15, 2012 at 7:00 PM, Eric Brine <ikegami@adaelis.com> wrote: > On Mon, May 14, 2012 at 7:37 PM, Father Chrysostomos via RT < > perlbug-followup@perl.org> wrote: > > Replacing the entersub op with something else is what > > cv_set_call_checker is for. > > I haven't found an example that removes from the opcode tree. How would I > fill in the following call checker > > STATIC OP* check_loop(pTHX_ OP* entersubop, GV* namegv, SV* ckobj) { > #define check_loop(a,b,c) check_loop(aTHX_ a,b,c) > PERL_UNUSED_ARG(namegv); > PERL_UNUSED_ARG(ckobj); > > return ...; > } > > to remove the entersub it's tied to? > Got it: OP* remove_sub_call(OP* entersubop) { OP* pushop; OP* realop; pushop = cUNOPx(entersubop)->op_first; if (!pushop->op_sibling) pushop = cUNOPx(pushop)->op_first; realop = pushop->op_sibling; if (!realop || !realop->op_sibling) return entersubop; pushop->op_sibling = realop->op_sibling; realop->op_sibling = NULL; op_free(entersubop); return realop; }Thread Previous