hax/force_list_keeping_pushmark.c.inc

filter: Statementstmt 90.9% 10 / 11 Branchbran 60.0% 6 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 76.1% 16 / 21 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« share-keyword/include/XSParseKeyword.h ↑ Summary src/keyword.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 39 static OP *S_force_list_keeping_pushmark(pTHX_ OP *o)
12 {
13 39 ▶ if(!o || o->op_type != OP_LIST) {
Branch: 2 branches
BranchTrueFalseTotal
if(!o || o->op_type != OP_LIST) { 39 0 39
if(!o || o->op_type != OP_LIST) { 28 11 39
14 28 OP *rest = NULL;
15 28 ▶ if(o) {
Branch: 1 branch
BranchTrueFalseTotal
if(o) { 28 0 28
16 28 ▶ rest = OpSIBLING(o);
Branch: 1 branch
BranchTrueFalseTotal
rest = OpSIBLING(o); 0 28 28
17 28 OpLASTSIB_set(o, NULL);
18 }
19 28 o = newLISTOP(OP_LIST, 0, o, NULL);
20 28 ▶ if(rest)
Branch: 1 branch
BranchTrueFalseTotal
if(rest) 0 28 28
21 0 op_sibling_splice(o, cLISTOPo->op_last, 0, rest);
22 }
23 39 op_null(o);
24 39 return op_contextualize(o, G_LIST);
25 }
« share-keyword/include/XSParseKeyword.h ↑ Summary src/keyword.c »