| 1 |
|
| #include <xs.h> |
| 2 |
|
| #include <xs/merge.h> |
| 3 |
|
| |
| 4 |
|
| using xs::Sv; |
| 5 |
|
| using xs::merge; |
| 6 |
|
| |
| 7 |
|
| typedef OP* (*opcheck_t) (pTHX_ OP* op); |
| 8 |
|
| static opcheck_t orig_opcheck = NULL; |
| 9 |
|
| |
| 10 |
65 |
| static OP* pp_sassign (pTHX) { |
| 11 |
65 |
| dSP; |
| 12 |
65 |
| Sv left = *SP; |
| 13 |
65 |
| Sv right = *(SP-1); |
| 14 |
|
| |
| 15 |
65 |
▶ | if (PL_op->op_private & OPpASSIGN_BACKWARDS) swap(left, right); |
Branch: 2 branches
| Branch | True | False | Total |
| if (PL_op->op_private & OPpASSIGN_BACKWARDS) swap(left, right); |
0 |
65 |
65 |
| if (PL_op->op_private & OPpASSIGN_BACKWARDS) swap(left, right); |
0 |
0 |
0 |
|
| 16 |
|
| |
| 17 |
65 |
▶ | if (left.is_hash_ref() && right.is_hash_ref()) { |
Branch: 5 branches
| Branch | True | False | Total |
| if (left.is_hash_ref() && right.is_hash_ref()) { |
65 |
0 |
65 |
| if (left.is_hash_ref() && right.is_hash_ref()) { |
3 |
62 |
65 |
| if (left.is_hash_ref() && right.is_hash_ref()) { |
3 |
0 |
3 |
| if (left.is_hash_ref() && right.is_hash_ref()) { |
3 |
0 |
3 |
| if (left.is_hash_ref() && right.is_hash_ref()) { |
3 |
62 |
65 |
|
| 18 |
3 |
▶ | xs::merge(left, right); |
Branch: 2 branches
| Branch | True | False | Total |
| xs::merge(left, right); |
3 |
0 |
3 |
| xs::merge(left, right); |
3 |
0 |
3 |
|
| 19 |
3 |
| POPs; SETs(left); |
| 20 |
3 |
| return NORMAL; |
| 21 |
|
| } |
| 22 |
|
| |
| 23 |
62 |
▶ | return PL_ppaddr[PL_op->op_type](aTHX); |
Branch: 1 branch
| Branch | True | False | Total |
| return PL_ppaddr[PL_op->op_type](aTHX); |
62 |
0 |
62 |
|
| 24 |
65 |
| } |
| 25 |
|
| |
| 26 |
65 |
| static OP* opcheck (pTHX_ OP* op) { |
| 27 |
65 |
▶ | OP* ret = orig_opcheck ? orig_opcheck(aTHX_ op) : op; |
Branch: 1 branch
| Branch | True | False | Total |
| OP* ret = orig_opcheck ? orig_opcheck(aTHX_ op) : op; |
65 |
0 |
65 |
|
| 28 |
65 |
| const char* packname = SvPVX(PL_curstname); |
| 29 |
65 |
| STRLEN packlen = SvCUR(PL_curstname); |
| 30 |
65 |
▶ | if (packlen < 2 || packname[0] != 'N' || packname[1] != 'S') return ret; |
Branch: 3 branches
| Branch | True | False | Total |
| if (packlen < 2 || packname[0] != 'N' || packname[1] != 'S') return ret; |
65 |
0 |
65 |
| if (packlen < 2 || packname[0] != 'N' || packname[1] != 'S') return ret; |
65 |
0 |
65 |
| if (packlen < 2 || packname[0] != 'N' || packname[1] != 'S') return ret; |
0 |
65 |
65 |
|
| 31 |
65 |
▶ | if (packlen > 2 && (packname[2] != ':' || packname[3] != ':')) return ret; |
Branch: 3 branches
| Branch | True | False | Total |
| if (packlen > 2 && (packname[2] != ':' || packname[3] != ':')) return ret; |
40 |
25 |
65 |
| if (packlen > 2 && (packname[2] != ':' || packname[3] != ':')) return ret; |
40 |
0 |
40 |
| if (packlen > 2 && (packname[2] != ':' || packname[3] != ':')) return ret; |
0 |
40 |
40 |
|
| 32 |
65 |
| ret->op_ppaddr = pp_sassign; |
| 33 |
65 |
| return ret; |
| 34 |
|
| } |
| 35 |
|
| |
| 36 |
13 |
| static void enable_op_tracking (pTHX) { |
| 37 |
13 |
▶ | if (PL_check[OP_SASSIGN] == opcheck) return; |
Branch: 1 branch
| Branch | True | False | Total |
| if (PL_check[OP_SASSIGN] == opcheck) return; |
0 |
13 |
13 |
|
| 38 |
13 |
| orig_opcheck = PL_check[OP_SASSIGN]; |
| 39 |
13 |
| PL_check[OP_SASSIGN] = opcheck; |
| 40 |
|
| } |
| 41 |
|
| |
| 42 |
13 |
| static void disable_op_tracking (pTHX) { |
| 43 |
13 |
▶ | if (PL_check[OP_SASSIGN] != opcheck) return; |
Branch: 1 branch
| Branch | True | False | Total |
| if (PL_check[OP_SASSIGN] != opcheck) return; |
0 |
13 |
13 |
|
| 44 |
13 |
| PL_check[OP_SASSIGN] = orig_opcheck; |
| 45 |
13 |
| orig_opcheck = NULL; |
| 46 |
|
| } |
| 47 |
|
| |
| 48 |
|
| MODULE = Panda::Config::Perl PACKAGE = Panda::Config::Perl |
| 49 |
|
| PROTOTYPES: DISABLE |
| 50 |
|
| |
| 51 |
|
| void enable_op_tracking () { |
| 52 |
13 |
| enable_op_tracking(aTHX); |
| 53 |
|
| } |
| 54 |
|
| |
| 55 |
|
| void disable_op_tracking () { |
| 56 |
13 |
| disable_op_tracking(aTHX); |
| 57 |
|
| } |