summaryrefslogtreecommitdiff
path: root/sv.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2020-06-29 11:06:04 -0600
committerKarl Williamson <khw@cpan.org>2022-06-13 06:05:09 -0600
commitfecef29147d516d89233c43e3a9c9800e6c7f9f4 (patch)
tree6cc0c143f4ab4f240d9eb27ad31573fec268223d /sv.h
parent41bd242f6bcefea589954de06bef8b8256401827 (diff)
downloadperl-fecef29147d516d89233c43e3a9c9800e6c7f9f4.tar.gz
Evaluate SET_SVANY_FOR_BODYLESS_[IN]V() param just once
Since these are defined for just the core, we can add STMT_START { ... } STMT_END without repercussions
Diffstat (limited to 'sv.h')
-rw-r--r--sv.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/sv.h b/sv.h
index 61ee90eb1f..e6c5dc28a6 100644
--- a/sv.h
+++ b/sv.h
@@ -2633,12 +2633,18 @@ Create a new IO, setting the reference count to 1.
* trick and store them in SvANY for SvIV() (and friends) to use. */
# define SET_SVANY_FOR_BODYLESS_IV(sv) \
- SvANY(sv) = (XPVIV*)((char*)&(sv->sv_u.svu_iv) \
- - STRUCT_OFFSET(XPVIV, xiv_iv))
+ STMT_START { \
+ SV * sv_ = MUTABLE_SV(sv); \
+ SvANY(sv_) = (XPVIV*)((char*)&(sv_->sv_u.svu_iv) \
+ - STRUCT_OFFSET(XPVIV, xiv_iv)); \
+ } STMT_END
# define SET_SVANY_FOR_BODYLESS_NV(sv) \
- SvANY(sv) = (XPVNV*)((char*)&(sv->sv_u.svu_nv) \
- - STRUCT_OFFSET(XPVNV, xnv_u.xnv_nv))
+ STMT_START { \
+ SV * sv_ = MUTABLE_SV(sv); \
+ SvANY(sv_) = (XPVNV*)((char*)&(sv_->sv_u.svu_nv) \
+ - STRUCT_OFFSET(XPVNV, xnv_u.xnv_nv)); \
+ } STMT_END
/*
* ex: set ts=8 sts=4 sw=4 et: