summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-05-12 14:08:45 +0000
committerNicholas Clark <nick@ccl4.org>2006-05-12 14:08:45 +0000
commita5f5288a1ce96404c41043e92557b8c1a5ad9e30 (patch)
tree2a1409ea42cbe587f5f33cab96ca90113e8a95da
parentf0f40d8670b7f33d2000added2e7cf136c08f07b (diff)
downloadperl-a5f5288a1ce96404c41043e92557b8c1a5ad9e30.tar.gz
The upgrade/croak order in Perl_sv_utf8_encode() seemed utterly
backwards. It now checks for readonly *first*. p4raw-id: //depot/perl@28178
-rw-r--r--sv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sv.c b/sv.c
index b014601b92..6c7071dd18 100644
--- a/sv.c
+++ b/sv.c
@@ -3100,13 +3100,13 @@ flag off so that it looks like octets again.
void
Perl_sv_utf8_encode(pTHX_ register SV *sv)
{
- (void) sv_utf8_upgrade(sv);
if (SvIsCOW(sv)) {
sv_force_normal_flags(sv, 0);
}
if (SvREADONLY(sv)) {
Perl_croak(aTHX_ PL_no_modify);
}
+ (void) sv_utf8_upgrade(sv);
SvUTF8_off(sv);
}