summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cop.h3
-rw-r--r--perl.c3
-rw-r--r--sv.h2
3 files changed, 3 insertions, 5 deletions
diff --git a/cop.h b/cop.h
index 8acdec87d0..01e83f4c1f 100644
--- a/cop.h
+++ b/cop.h
@@ -670,8 +670,7 @@ struct block_format {
#define LEAVESUB(sv) \
STMT_START { \
- if (sv) \
- SvREFCNT_dec(sv); \
+ SvREFCNT_dec(sv); \
} STMT_END
#define POPFORMAT(cx) \
diff --git a/perl.c b/perl.c
index 0cfb73ca60..0e56b88783 100644
--- a/perl.c
+++ b/perl.c
@@ -2252,8 +2252,7 @@ S_parse_body(pTHX_ char **env, XSINIT_t xsinit)
#endif
lex_start(linestr_sv, rsfp, lex_start_flags);
- if(linestr_sv)
- SvREFCNT_dec(linestr_sv);
+ SvREFCNT_dec(linestr_sv);
PL_subname = newSVpvs("main");
diff --git a/sv.h b/sv.h
index f01a91c476..1eb8f1f095 100644
--- a/sv.h
+++ b/sv.h
@@ -284,7 +284,7 @@ to return a meaningful value, or check for NULLness, so it's smaller
and faster.
=for apidoc Am|void|SvREFCNT_dec|SV* sv
-Decrements the reference count of the given SV.
+Decrements the reference count of the given SV. I<sv> may be be NULL.
=for apidoc Am|void|SvREFCNT_dec_NN|SV* sv
Same as SvREFCNT_dec, but can only be used if you know I<sv>