summaryrefslogtreecommitdiff
path: root/vxs.inc
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-09-10 23:46:47 -0700
committerFather Chrysostomos <sprout@cpan.org>2014-01-04 05:10:02 -0800
commit8372457d1524e39b82376911e4ffb3a9d3864269 (patch)
tree91bdc518502b36cf70494c5eea9e572879d44a6c /vxs.inc
parent04df8d4df8f6391c0726976d187ee9caf7a049c2 (diff)
downloadperl-8372457d1524e39b82376911e4ffb3a9d3864269.tar.gz
vxs.inc: arg list checking for UNIVERSAL::VERSION
This brings it in line with the CPAN implementation. It’s hard to test this, as the tests should go in cpan/version, but the pure-Perl implementation doesn’t check the number of arguments.
Diffstat (limited to 'vxs.inc')
-rw-r--r--vxs.inc3
1 files changed, 3 insertions, 0 deletions
diff --git a/vxs.inc b/vxs.inc
index 2aa93d1bd1..646a532154 100644
--- a/vxs.inc
+++ b/vxs.inc
@@ -62,6 +62,9 @@ XS(XS_UNIVERSAL_VERSION)
const char *undef;
PERL_UNUSED_ARG(cv);
+ if (items < 1)
+ Perl_croak(aTHX_ "Usage: UNIVERSAL::VERSION(sv, ...)");
+
if (SvROK(ST(0))) {
sv = MUTABLE_SV(SvRV(ST(0)));
if (!SvOBJECT(sv))