Why is callback not called?

I have an example script from B :: OPCheck with changed PL_op_nametopadsv

use B::Generate;

use B::OPCheck padsv => check => sub {
    my $op = shift;
    print "HERE";
};

my $x;
1;

But callback is not called.

When canceling this program, I see this OP:

$perl -Ilib -Iblib/arch -MO=Terse ~/tmp/xs.pl

LISTOP (0x19828f0) leave [1] 
    OP (0x1c27ef0) enter 
    COP (0x1982938) nextstate 
    OP (0x1982998) padsv [1]           <<<< HERE IT IS
    COP (0x1c27f38) nextstate 
    OP (0x1c27f98) null [5] 

Why is callback not called?

UPD
It seems here is the answer:

For most (but not all) types of op, after op was originally created and populated by child ops, it will be filtered through the check function referenced by the corresponding element of this array

But where can I find a list of ops that will be filtered through the check function?

+4
source share
1 answer

I will find out the following. I have to do

wrap_op_checker(OP_PADANY, my_check, &old_checker);

Instead:

wrap_op_checker(OP_PADSV, my_check, &old_checker);

OP . OP_PADANY OP_PADSV Perl_newSVREF, - Perl_yyparse+0x1834.

- OP_PADSV

UPD
DOC

, node

+2

Source: https://habr.com/ru/post/1670822/


All Articles