diff options
author | Nicholas Clark <nick@ccl4.org> | 2005-06-10 15:44:47 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2005-06-10 15:44:47 +0000 |
commit | 729c079f503f2192381f3dac342bae6ced6ca379 (patch) | |
tree | 8caf7afd63e274a01c2b665fc4040fd735008c06 /pp_sys.c | |
parent | ff97eb1bb7f5e6592d7d43ba06691bdde9554da8 (diff) | |
download | perl-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.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -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; } |