summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-06-10 15:44:47 +0000
committerNicholas Clark <nick@ccl4.org>2005-06-10 15:44:47 +0000
commit729c079f503f2192381f3dac342bae6ced6ca379 (patch)
tree8caf7afd63e274a01c2b665fc4040fd735008c06 /pp_sys.c
parentff97eb1bb7f5e6592d7d43ba06691bdde9554da8 (diff)
downloadperl-729c079f503f2192381f3dac342bae6ced6ca379.tar.gz
Passing read only values (such as string constants) to select should
croak. p4raw-id: //depot/perl@24795
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/pp_sys.c b/pp_sys.c
index ff80272869..1444a0f862 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -1024,9 +1024,16 @@ PP(pp_sselect)
SP -= 4;
for (i = 1; i <= 3; i++) {
- if (!SvPOK(SP[i]))
+ SV *sv = SP[i];
+ if (SvOK(sv) && SvREADONLY(sv)) {
+ if (SvIsCOW(sv))
+ sv_force_normal_flags(sv, 0);
+ if (SvREADONLY(sv))
+ DIE(aTHX_ PL_no_modify);
+ }
+ if (!SvPOK(sv))
continue;
- j = SvCUR(SP[i]);
+ j = SvCUR(sv);
if (maxlen < j)
maxlen = j;
}