Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 1471505 Details for
Bug 1609708
Mishandling of undef values in Math::BigInt
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Fix ported from Math-BigInt-1.9995
perl-5.16.3-Math-BigInt-Objectify-undef.patch (text/plain), 2.18 KB, created by
Petr Pisar
on 2018-07-30 11:32:50 UTC
(
hide
)
Description:
Fix ported from Math-BigInt-1.9995
Filename:
MIME Type:
Creator:
Petr Pisar
Created:
2018-07-30 11:32:50 UTC
Size:
2.18 KB
patch
obsolete
>From 0ca77003917253579289a8b7b96a559972b5cd45 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com> >Date: Mon, 30 Jul 2018 12:23:43 +0200 >Subject: [PATCH] Math::BigInt: Objectify undef >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Perl coerces undef value to 0 in a numerical context. Using bignum for >transparent big numbers support converts numbers to Math::BigInt and >Math::BigFloat objects and these objects overload operators. These >operators transparantly convert the other operand to given class. > >However, Math::BigInt as found in Perl 5.16.3 did not convert undef >value (for performance reason). This manifested in this bug: > >$ perl -e 'use bignum; 0 + undef;' >Can't call method "isa" on an undefined value at /usr/share/perl5/Math/BigInt.pm line 1131. > >This patch is a backport of CPAN RT#80162 fix from Math-BigInt-1.9995. > >Signed-off-by: Petr PÃsaÅ <ppisar@redhat.com> >--- > dist/Math-BigInt/lib/Math/BigInt.pm | 18 ++++++------------ > 1 file changed, 6 insertions(+), 12 deletions(-) > >diff --git a/dist/Math-BigInt/lib/Math/BigInt.pm b/dist/Math-BigInt/lib/Math/BigInt.pm >index 701a3e1..08d2af3 100644 >--- a/dist/Math-BigInt/lib/Math/BigInt.pm >+++ b/dist/Math-BigInt/lib/Math/BigInt.pm >@@ -2662,28 +2662,22 @@ sub objectify { > for my $i (1 .. $count) { > my $ref = ref $a[$i]; > >- # If it is an object of the right class, all is fine. >- >- if ($ref eq $a[0]) { >- next; >- } >- >- # Don't do anything with undefs. >+ # Perl scalars are fed to the appropriate constructor. > >- unless (defined($a[$i])) { >+ unless ($ref) { >+ $a[$i] = $a[0] -> new($a[$i]); > next; > } > >- # Perl scalars are fed to the appropriate constructor. >+ # If it is an object of the right class, all is fine. > >- unless ($ref) { >- $a[$i] = $a[0] -> new($a[$i]); >+ if ($ref -> isa($a[0])) { > next; > } > > # Upgrading is OK, so skip further tests if the argument is upgraded. > >- if (defined $up && $ref eq $up) { >+ if (defined $up && $ref -> isa($up)) { > next; > } > >-- >2.14.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1609708
:
1471448
| 1471505