hax/force_list_keeping_pushmark.c.inc

filter: Statementstmt 90.9% 10 / 11 Branchbran 50.0% 5 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 71.4% 15 / 21 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« hax/make_argcheck_ops.c.inc ↑ Summary src/class.c »
1 /* vi: set ft=c : */
2  
3 #include "op_sibling_splice.c.inc"
4  
5 /* force_list_keeping_pushmark nulls out the OP_LIST itself but preserves
6 * the OP_PUSHMARK inside it. This is essential or else op_contextualize()
7 * will null out both of them and we lose the mark
8 */
9 /* copypasta from core's op.c */
10 #define force_list_keeping_pushmark(o) S_force_list_keeping_pushmark(aTHX_ o)
11 20 static OP *S_force_list_keeping_pushmark(pTHX_ OP *o)
12 {
13 20 ▶ if(!o || o->op_type != OP_LIST) {
Branch: 2 branches
BranchTrueFalseTotal
if(!o || o->op_type != OP_LIST) { 20 0 20
if(!o || o->op_type != OP_LIST) { 20 0 20
14 20 OP *rest = NULL;
15 20 ▶ if(o) {
Branch: 1 branch
BranchTrueFalseTotal
if(o) { 20 0 20
16 20 ▶ rest = OpSIBLING(o);
Branch: 1 branch
BranchTrueFalseTotal
rest = OpSIBLING(o); 0 20 20
17 20 OpLASTSIB_set(o, NULL);
18 }
19 20 o = newLISTOP(OP_LIST, 0, o, NULL);
20 20 ▶ if(rest)
Branch: 1 branch
BranchTrueFalseTotal
if(rest) 0 20 20
21 0 op_sibling_splice(o, cLISTOPo->op_last, 0, rest);
22 }
23 20 op_null(o);
24 20 return op_contextualize(o, G_LIST);
25 }
« hax/make_argcheck_ops.c.inc ↑ Summary src/class.c »