summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-11-22 21:28:15 -0800
committerFather Chrysostomos <sprout@cpan.org>2011-11-22 21:29:35 -0800
commitbc4eb4d6f895e86a4afbc016eae943c7546c35f2 (patch)
treeef18a6108892dffc3ebf5c7bdc667133a2b37b4f /lib
parenta3f353cf7aaf90ddfb021a9733ff75f4437d4e70 (diff)
downloadperl-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 'lib')
-rw-r--r--lib/version.t13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/version.t b/lib/version.t
index dd47e87654..da1102378a 100644
--- a/lib/version.t
+++ b/lib/version.t
@@ -739,6 +739,19 @@ SKIP: {
}
}
+eval { version->new("version") };
+pass('no crash with version->new("version")');
+{
+ package _102586;
+ sub TIESCALAR { bless [] }
+ sub FETCH { "version" }
+ sub STORE { }
+ tie my $v, __PACKAGE__;
+ $v = version->new(1);
+ eval { version->new($v) };
+}
+pass('no crash with version->new($tied) where $tied returns "version"');
+
1;
__DATA__