This repository was archived by the owner on Jun 1, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -1189,7 +1189,21 @@ C<sv_force_normal> does nothing.
11891189#else
11901190# define SvREADONLY_on (sv ) (SvFLAGS(sv) |= SVf_READONLY)
11911191# ifdef USE_CPERL
1192- # /* double evaluation! */
1192+ # if defined(__GNUC__ ) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN )
1193+ # /* can avoid double evaluation */
1194+ # define SvREADONLY_off (sv ) \
1195+ ({ SV *const _sv = MUTABLE_SV(sv); \
1196+ if ((SV*)(_sv) == &PL_sv_placeholder \
1197+ || (SV*)(_sv) == &PL_sv_undef \
1198+ || (SV*)(_sv) == &PL_sv_yes \
1199+ || (SV*)(_sv) == &PL_sv_no \
1200+ || (SV*)(_sv) == (SV*)&PL_padname_const \
1201+ || (SV*)(_sv) == (SV*)&PL_defstash) \
1202+ croak_no_modify(); \
1203+ else \
1204+ SvFLAGS(_sv) &= ~SVf_READONLY; \
1205+ })
1206+ # else
11931207# define SvREADONLY_off (sv ) \
11941208 if ((SV*)(sv) == &PL_sv_placeholder \
11951209 || (SV*)(sv) == &PL_sv_undef \
@@ -1200,6 +1214,7 @@ C<sv_force_normal> does nothing.
12001214 croak_no_modify(); \
12011215 else \
12021216 (SvFLAGS(sv) &= ~SVf_READONLY)
1217+ # endif
12031218# else
12041219# define SvREADONLY_off (sv ) (SvFLAGS(sv) &= ~SVf_READONLY)
12051220# endif
You can’t perform that action at this time.
0 commit comments