Skip Menu |
 

This queue is for tickets about the Math-BigInt-FastCalc CPAN distribution.

Report information
The Basics
Id: 29720
Status: resolved
Worked: 25 min
Priority: 0/
Queue: Math-BigInt-FastCalc

People
Owner: TELS [...] cpan.org
Requestors: ATOURBIN [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in:
  • 0.15
  • 0.16
Fixed in: (no value)



Subject: breaks Convert::ASN1 test
Download (untitled) / with headers
text/plain 269b
Math-BigInt-FastCalc-0.15, along with Math-BigInt-1.87, seems to break Convert-ASN1 test suite: $ perl -Mblib t/06bigint.t 1..67 [...] # INTEGER 2147483648 ok 52 ok 53 ok 54 #55: expecting 2147483648 #55: got 2147483648 #line 106 t/06bigint.t not ok 55 [...] $
Download (untitled) / with headers
text/plain 688b
The problem goes as this: with Math-BigInst-FastClac-0.13: $ perl -MData::Dumper -MMath::BigInt -e 'print Dumper(Math::BigInt->new(2**31))' $VAR1 = bless( { 'value' => [ '7483648', '214' ], 'sign' => '+' }, 'Math::BigInt' ); $ with Math-BigInst-FastClac-0.15: $ perl -MData::Dumper -MMath::BigInt -e 'print Dumper(Math::BigInt->new(2**31))' $VAR1 = bless( { 'value' => [ 2147483648 ], 'sign' => '+' }, 'Math::BigInt' ); $
Subject: integer overflow in Math-BigInt-FastCalc-0.15
Download (untitled) / with headers
text/plain 398b
Here is the patch that fixes integer overflow in FastCalc.xs:_new(). --- a/FastCalc.xs +++ b/FastCalc.xs @@ -59,7 +59,7 @@ _new(class, x) /* create the array */ RETVAL = newAV(); sv_2mortal((SV*)RETVAL); - if (SvIOK(x) && SvIV(x) < XS_BASE) + if (SvUOK(x) && SvUV(x) < XS_BASE) { /* shortcut for integer arguments */ av_push (RETVAL, newSVuv( SvUV(x) ));
Download (untitled) / with headers
text/plain 110b
This issue should be resolved with the release of v0.16 of Math::BigInt::FastCalc - thank you for your report!
Download (untitled) / with headers
text/plain 306b
On Sat Apr 05 11:47:12 2008, TELS wrote: Show quoted text
> This issue should be resolved with the release of v0.16 of > Math::BigInt::FastCalc - thank you for your report!
In version 0.16, you changed only SvIV(x) to SvUV(x), but SvIOK(x) test left unchanged. But you've got to test for SvUOK(x) before invoking SvUV(x).
Subject: Re: [rt.cpan.org #29720] breaks Convert::ASN1 test
Date: Sun, 13 Apr 2008 12:45:07 +0200
To: bug-Math-BigInt-FastCalc [...] rt.cpan.org
From: Tels <nospam-abuse [...] bloodgate.com>
Download (untitled) / with headers
text/plain 783b
On Sunday 13 April 2008 12:15:37 Alexey Tourbin via RT wrote: Show quoted text
> Queue: Math-BigInt-FastCalc > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=29720 > > > On Sat Apr 05 11:47:12 2008, TELS wrote:
> > This issue should be resolved with the release of v0.16 of > > Math::BigInt::FastCalc - thank you for your report!
> > In version 0.16, you changed only SvIV(x) to SvUV(x), > but SvIOK(x) test left unchanged. But you've got to test > for SvUOK(x) before invoking SvUV(x).
Oops, good catch. I'll fix it ASAP. All the best, Tels -- Signed on Sun Apr 13 12:44:19 2008 with key 0x93B84C15. Get one of my photo posters: http://bloodgate.com/posters PGP key on http://bloodgate.com/tels.asc or per email. "Man, I'm hot." - "Thirsty?" - "No, I mean good looking."
Download (untitled)
application/pgp-signature 481b

Message body not shown because it is not plain text.

Should now be really solved with the release of v0.17 on CPAN - Thanx for your report!


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.