diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-11-23 12:47:50 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-11-24 01:45:28 -0800 |
commit | d31021d22e76a02635b33b5504e52db88adfc5f0 (patch) | |
tree | 5871f655f55d99ec7126d85ba4a87bafa30ceddd /util.c | |
parent | c404d42afdfcd548f3486781fd748ae2b462f6d4 (diff) | |
download | perl-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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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) ) { |