summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-11-23 12:47:50 -0800
committerFather Chrysostomos <sprout@cpan.org>2011-11-24 01:45:28 -0800
commitd31021d22e76a02635b33b5504e52db88adfc5f0 (patch)
tree5871f655f55d99ec7126d85ba4a87bafa30ceddd /util.c
parentc404d42afdfcd548f3486781fd748ae2b462f6d4 (diff)
downloadperl-d31021d22e76a02635b33b5504e52db88adfc5f0.tar.gz
Use correct err msg in XS version check
When an XS module’s version is checked when it is loading, the string "version" should be treated the same way as "versions" and emit the ‘Invalid version format’ error, instead of being treated as a version object at first and then rejected by the validator with the ‘Invalid version object’ error. See also perl #102586.
Diffstat (limited to 'util.c')
-rw-r--r--util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util.c b/util.c
index 4a170aa24b..052cb2c87e 100644
--- a/util.c
+++ b/util.c
@@ -6430,7 +6430,7 @@ Perl_xs_version_bootcheck(pTHX_ U32 items, U32 ax, const char *xs_p,
}
if (sv) {
SV *xssv = Perl_newSVpvn_flags(aTHX_ xs_p, xs_len, SVs_TEMP);
- SV *pmsv = sv_derived_from(sv, "version")
+ SV *pmsv = sv_derived_from(sv, "version") && SvROK(sv)
? sv : sv_2mortal(new_version(sv));
xssv = upg_version(xssv, 0);
if ( vcmp(pmsv,xssv) ) {