case VMG_OP_INFO_OBJECT: {
dMY_CXT;
return sv_bless(sv_2mortal(newRV_noinc(newSViv(PTR2IV(PL_op)))),
- gv_stashpv(vmg_opclassnames[vmg_opclass(PL_op)], 1));
+ MY_CXT.b__op_stashes[vmg_opclass(PL_op)]);
}
default:
break;
MY_CXT.wizards = hv;
for (c = 0; c < OPc_MAX; ++c) {
MY_CXT.b__op_stashes[c] = (had_b__op_stash & (((U32) 1) << c))
- ? gv_stashpv("B::OP", 1) : NULL;
+ ? gv_stashpv(vmg_opclassnames[c], 1) : NULL;
}
}
sig => $sig,
get => sub { ++$c; 0 },
set => sub {
- my $name = $_[-1];
- $name = $name->name if $op_info == VMG_OP_INFO_OBJECT;
- is $name, 'sassign', "opname for op_info $op_info in thread $tid is correct";
+ my $op = $_[-1];
+ if ($op_info == VMG_OP_INFO_OBJECT) {
+ is_deeply { class => ref($op), name => $op->name },
+ { class => 'B::BINOP', name => 'sassign' },
+ "op object in thread $tid is correct";
+ } else {
+ is $op, 'sassign', "op name in thread $tid is correct";
+ }
0
},
free => sub { ++$destroyed; 0 },
wizard data => sub { $_[1] + threads->tid() },
get => sub { ++$c; 0 },
set => sub {
- my $name = $_[-1];
- $name = $name->name if $op_info == VMG_OP_INFO_OBJECT;
+ my $op = $_[-1];
my $tid = threads->tid();
- is $name, 'sassign', "opname for op_info $op_info in thread $tid is correct";
+ if ($op_info == VMG_OP_INFO_OBJECT) {
+ is_deeply { class => ref($op), name => $op->name },
+ { class => 'B::BINOP', name => 'sassign' },
+ "op object in thread $tid is correct";
+ } else {
+ is $op, 'sassign', "op name in thread $tid is correct";
+ }
0
},
free => sub { ++$destroyed; 0 },