Skip to content

Commit a6773db

Browse files
committed
Eval arg to SvSETMAGIC just once
1 parent 354ba92 commit a6773db

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sv.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2459,7 +2459,11 @@ that already have a PV buffer allocated, but no SvTHINKFIRST.
24592459
#define SvUNLOCK(sv) PL_unlockhook(aTHX_ sv)
24602460
#define SvDESTROYABLE(sv) PL_destroyhook(aTHX_ sv)
24612461

2462-
#define SvSETMAGIC(x) STMT_START { if (UNLIKELY(SvSMAGICAL(x))) mg_set(x); } STMT_END
2462+
#define SvSETMAGIC(x) \
2463+
STMT_START { \
2464+
SV * sv_svsetmagic_ = MUTABLE_SV(x); \
2465+
if (UNLIKELY(SvSMAGICAL(sv_svsetmagic_))) mg_set(sv_svsetmagic_); \
2466+
} STMT_END
24632467

24642468
#define SvSetSV_and(dst,src,finally) \
24652469
STMT_START { \

0 commit comments

Comments
 (0)