File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -47,3 +47,9 @@ ok defined($v), 'Fix for RT #47980';
47
47
like $@ , qr ' Usage: version::new\( class, version\) ' ,
48
48
' No implicit object creation when called as function' ;
49
49
}
50
+
51
+ {
52
+ eval { version::vcmp($^V) };
53
+ like $@ , qr { Usage: version::\S +\( lobj, \.\.\.\) } ,
54
+ ' vcmp method throws error on single argument' ;
55
+ }
Original file line number Diff line number Diff line change @@ -312,7 +312,7 @@ VXS(version_normal)
312
312
VXS (version_vcmp)
313
313
{
314
314
dXSARGS;
315
- if (items < 1 )
315
+ if (items < 2 )
316
316
croak_xs_usage (cv, " lobj, ..." );
317
317
SP -= items;
318
318
{
@@ -322,7 +322,7 @@ VXS(version_vcmp)
322
322
SV *rs;
323
323
SV *rvs;
324
324
SV * robj = ST (1 );
325
- const IV swap = (IV) SvIV ( ST (2 ));
325
+ const int swap = items > 2 ? SvTRUE ( ST (2 )) : 0 ;
326
326
327
327
if ( !ISA_VERSION_OBJ (robj) )
328
328
{
You can’t perform that action at this time.
0 commit comments