Skip to content

Commit

Permalink
sv.c: Make sv_force_normal always croak on ro SVs
Browse files Browse the repository at this point in the history
Commit 8990e30 (perl 5.0 alpha 6) changed several SvREADONLY checks
to apply only to run time.  This is convenient when it comes to modify-
ing op trees, whose SVs are, for the most part, marked read-only.

But several pieces of code that relied on this were buggy when dealing
with constants created by ‘use constant’.  To make it harder to add
such bugs, I have changed all code that relies on this exception and
am now removing it.
  • Loading branch information
Father Chrysostomos committed Jun 23, 2013
1 parent 0bcd71e commit c72a4ee
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions sv.c
Expand Up @@ -4861,7 +4861,6 @@ Perl_sv_force_normal_flags(pTHX_ SV *const sv, const U32 flags)

#ifdef PERL_ANY_COW
if (SvREADONLY(sv)) {
if (IN_PERL_RUNTIME)
Perl_croak_no_modify();
}
else if (SvIsCOW(sv)) {
Expand Down Expand Up @@ -4920,7 +4919,6 @@ Perl_sv_force_normal_flags(pTHX_ SV *const sv, const U32 flags)
}
#else
if (SvREADONLY(sv)) {
if (IN_PERL_RUNTIME)
Perl_croak_no_modify();
}
else
Expand Down

0 comments on commit c72a4ee

Please sign in to comment.