From 2f995715b99bbbe6f6e89b02b509a1f99f41ecd4 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Tue, 4 Dec 2012 22:09:29 -0800 Subject: Use SvREFCNT_dec_NN in various cop.h macros Many of these SVs are never null, and therefore need no null checks. --- cop.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'cop.h') diff --git a/cop.h b/cop.h index 74ec151a45..0a682f15e2 100644 --- a/cop.h +++ b/cop.h @@ -653,7 +653,7 @@ struct block_format { /* abandon @_ if it got reified */ \ if (AvREAL(cx->blk_sub.argarray)) { \ const SSize_t fill = AvFILLp(cx->blk_sub.argarray); \ - SvREFCNT_dec(cx->blk_sub.argarray); \ + SvREFCNT_dec_NN(cx->blk_sub.argarray); \ cx->blk_sub.argarray = newAV(); \ av_extend(cx->blk_sub.argarray, fill); \ AvREIFY_only(cx->blk_sub.argarray); \ @@ -677,8 +677,9 @@ struct block_format { #define POPFORMAT(cx) \ setdefout(cx->blk_format.dfoutgv); \ CvDEPTH(cx->blk_format.cv)--; \ - if (!CvDEPTH(cx->blk_format.cv)) SvREFCNT_dec(cx->blk_format.cv); \ - SvREFCNT_dec(cx->blk_format.dfoutgv); + if (!CvDEPTH(cx->blk_format.cv)) \ + SvREFCNT_dec_NN(cx->blk_format.cv); \ + SvREFCNT_dec_NN(cx->blk_format.dfoutgv); /* eval context */ struct block_eval { @@ -717,7 +718,7 @@ struct block_eval { optype = CxOLD_OP_TYPE(cx); \ PL_eval_root = cx->blk_eval.old_eval_root; \ if (cx->blk_eval.cur_text && SvSCREAM(cx->blk_eval.cur_text)) \ - SvREFCNT_dec(cx->blk_eval.cur_text); \ + SvREFCNT_dec_NN(cx->blk_eval.cur_text); \ if (cx->blk_eval.old_namesv) \ sv_2mortal(cx->blk_eval.old_namesv); \ } STMT_END @@ -783,8 +784,8 @@ struct block_loop { #define POPLOOP(cx) \ if (CxTYPE(cx) == CXt_LOOP_LAZYSV) { \ - SvREFCNT_dec(cx->blk_loop.state_u.lazysv.cur); \ - SvREFCNT_dec(cx->blk_loop.state_u.lazysv.end); \ + SvREFCNT_dec_NN(cx->blk_loop.state_u.lazysv.cur); \ + SvREFCNT_dec_NN(cx->blk_loop.state_u.lazysv.end); \ } \ if (CxTYPE(cx) == CXt_LOOP_FOR) \ SvREFCNT_dec(cx->blk_loop.state_u.ary.ary); -- cgit v1.2.1