diff options
author | Father Chrysostomos <sprout@cpan.org> | 2013-07-25 23:09:58 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-08-22 08:28:09 -0700 |
commit | d4a823b39f889d5a3c4b03856f90f4d11577e5a0 (patch) | |
tree | d67e03e11f12859801efa294a21ddf2f0d48ed6d /mg.c | |
parent | 0244b87952f6bbb22aa8d14f3fc0b12b65c664e4 (diff) | |
download | perl-d4a823b39f889d5a3c4b03856f90f4d11577e5a0.tar.gz |
Fix assertion failure with $#a=\1
If the array has been freed and a reference is then assigned to
the arylen scalar and then get-magic is called on that scalar,
Perl_magic_getarylen misbehaves. SvOK_off is not sufficient if
arbitrary values can be assigned by Perl code. Globs, refs and
regexps (among others) need special handling, which sv_setsv
knows how to do.
Diffstat (limited to 'mg.c')
-rw-r--r-- | mg.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2020,7 +2020,7 @@ Perl_magic_getarylen(pTHX_ SV *sv, const MAGIC *mg) if (obj) { sv_setiv(sv, AvFILL(obj)); } else { - SvOK_off(sv); + sv_setsv(sv, NULL); } return 0; } |