diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-11-22 21:28:15 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-11-22 21:29:35 -0800 |
commit | bc4eb4d6f895e86a4afbc016eae943c7546c35f2 (patch) | |
tree | ef18a6108892dffc3ebf5c7bdc667133a2b37b4f /util.c | |
parent | a3f353cf7aaf90ddfb021a9733ff75f4437d4e70 (diff) | |
download | perl-bc4eb4d6f895e86a4afbc016eae943c7546c35f2.tar.gz |
[perl #102586] version->new("version") SEGVs
This adds an ROK check after calling sv_derived_from, as the latter
also works for class names. It is done after sv_derived_from, rather
than before, as sv_derived_from calls get-magic.
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -4857,7 +4857,8 @@ Perl_new_version(pTHX_ SV *ver) dVAR; SV * const rv = newSV(0); PERL_ARGS_ASSERT_NEW_VERSION; - if ( sv_derived_from(ver,"version") ) /* can just copy directly */ + if ( sv_derived_from(ver,"version") && SvROK(ver) ) + /* can just copy directly */ { I32 key; AV * const av = newAV(); |