Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 polymake (4.0-2) unstable; urgency=medium
 .
   [ Benjamin Lorenz ]
   * New upstream version 4.0.
   * Add dependencies for flint and MongoDB interfaces.
   * Full singular is needed at runtime.
   * Remove libxml-perl and libxslt-perl deps and add libjson-perl due
     to file format change.
   * libxml-writer-perl is still needed for the x3d interface.
   * libxml-sax-perl for reading the old xml file format.
   * Bug fix: "polymake: FTBFS: test failure", thanks to Mattia Rizzolo
     (Closes: #949247)
   * Assert compliance with policy 4.5.0
 .
   [ David Bremner ]
   * use single-debian-patch to work from salsa.
   * Cut number of compile processes in half, use 4G per process.
Author: David Bremner <bremner@debian.org>
Bug-Debian: https://bugs.debian.org/949247

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: 2020-02-07

--- polymake-4.0.orig/lib/core/include/Integer.h
+++ polymake-4.0/lib/core/include/Integer.h
@@ -1575,7 +1575,9 @@ namespace pm {
 inline
 bool isfinite(const Integer& a) noexcept
 {
-   return a.get_rep()->_mp_alloc;
+   // gmp 6.2.0 allows lazy mpz types with alloc == 0 but non-zero data pointer
+   // initialized via mpz_roinit_n
+   return a.get_rep()->_mp_alloc || a.get_rep()->_mp_d != nullptr;
 }
 
 inline
--- polymake-4.0.orig/lib/core/include/Rational.h
+++ polymake-4.0/lib/core/include/Rational.h
@@ -1924,7 +1924,9 @@ namespace pm {
 inline
 bool isfinite(const Rational& a) noexcept
 {
-   return mpq_numref(a.get_rep())->_mp_alloc;
+   // gmp 6.2.0 allows lazy mpz types with alloc == 0 but non-zero data pointer
+   // initialized via mpz_roinit_n
+   return mpq_numref(a.get_rep())->_mp_alloc || mpq_numref(a.get_rep())->_mp_d != nullptr;
 }
 
 inline
