diff options
author | Father Chrysostomos <sprout@cpan.org> | 2013-06-26 00:18:03 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-06-26 01:12:10 -0700 |
commit | 20d5dc239d1bc8440adfec25faf617e0e444f64e (patch) | |
tree | 8ebab95b5783396ff210544b5e03d3317dfd7706 /scope.c | |
parent | ae3f739188e3ee21fa593cafc28023c533e8d9bf (diff) | |
download | perl-20d5dc239d1bc8440adfec25faf617e0e444f64e.tar.gz |
In-place sort should not leave array read-only
$ ./perl -Ilib -e '@a=1..2; eval { @a=sort{die} @a }; warn "ok so far\n"; @a = 1'
ok so far
Modification of a read-only value attempted at -e line 1.
If something goes wrong inside the sort block and it dies, we still
need to make sure we turn off the read-only flag on that array.
Diffstat (limited to 'scope.c')
-rw-r--r-- | scope.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -1228,6 +1228,9 @@ Perl_leave_scope(pTHX_ I32 base) case SAVEt_PARSER: parser_free((yy_parser *) ARG0_PTR); break; + case SAVEt_READONLY_OFF: + SvREADONLY_off(ARG0_SV); + break; default: Perl_croak(aTHX_ "panic: leave_scope inconsistency %u", type); } |