Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rt #122582 #60

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ListUtil.xs
Original file line number Diff line number Diff line change
Expand Up @@ -1273,13 +1273,13 @@ CODE:
SvNOK_on(TARG);
}
#ifdef SVf_IVisUV
else if(SvUOK(num)) {
if(SvUOK(num)) {
SvUV_set(TARG, SvUV(num));
SvIOK_on(TARG);
SvIsUV_on(TARG);
}
#endif
else {
if(SvIOK(num)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this else is going to disappear, I feel that the else on line 1197 above ought to too.

SvIV_set(TARG, SvIV(num));
SvIOK_on(TARG);
}
Expand Down
9 changes: 8 additions & 1 deletion t/dualvar.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use warnings;
use Scalar::Util ();
use Test::More (grep { /dualvar/ } @Scalar::Util::EXPORT_FAIL)
? (skip_all => 'dualvar requires XS version')
: (tests => 41);
: (tests => 42);
use Config;

Scalar::Util->import('dualvar');
Expand Down Expand Up @@ -131,3 +131,10 @@ SKIP: {
ok(isdual($ary[2]), 'Is a dualvar');
}

SKIP: {
skip("Test only works on 64 bit architectures", 1) unless log(~0 +1)/log(2) == 64;

# RT #122582: dual var not copying numeric value correctly
my $a = "4611686018427387915";
is $a - (1<<62), dualvar($a, "foo") - (1<<62), 'Should match';
}