diff options
author | Father Chrysostomos <sprout@cpan.org> | 2013-11-03 04:47:17 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-11-04 05:10:18 -0800 |
commit | 7274b33cb1232fb4911cb441bae8e0abebf734f2 (patch) | |
tree | d76bed36f2eb81d720f04346a3c5d2d92367f5fb /av.c | |
parent | ca58dfd9e0b19f1ae344f4aea62e3e4193f9c34f (diff) | |
download | perl-7274b33cb1232fb4911cb441bae8e0abebf734f2.tar.gz |
sub NEGATIVE_INDICES; + $tied[-1] = crash
This code in av.c, when trying to find $NEGATIVE_INDICES, was doing a
direct stash element lookup--instead of going through the normal GV
functions--and then expecting the returned value to be a GV.
‘sub NEGATIVE_INDICES’ creates a stash element that is a PV, not a GV,
so it’s easy to make things crash.
Diffstat (limited to 'av.c')
-rw-r--r-- | av.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -201,7 +201,8 @@ S_adjust_index(pTHX_ AV *av, const MAGIC *mg, SSize_t *keyp) SV * const * const negative_indices_glob = hv_fetchs(SvSTASH(SvRV(ref)), NEGATIVE_INDICES_VAR, 0); - if (negative_indices_glob && SvTRUE(GvSV(*negative_indices_glob))) + if (negative_indices_glob && isGV(*negative_indices_glob) + && SvTRUE(GvSV(*negative_indices_glob))) adjust_index = 0; } } |