diff options
author | Gard Spreemann <gspr@nonempty.org> | 2020-03-08 15:16:06 +0100 |
---|---|---|
committer | Gard Spreemann <gspr@nonempty.org> | 2020-03-08 15:16:06 +0100 |
commit | 8b4cbd706e0a8386a5d6c0f0bd9ae8af66c05848 (patch) | |
tree | 4596b2068cdc65b5056b524f5a2b9a8c55885827 | |
parent | 90e78305c8260c0f86ed330d263009004877a8db (diff) |
Add patch to prevent overflow on 32 bit architectures.
-rw-r--r-- | debian/changelog | 6 | ||||
-rw-r--r-- | debian/patches/0001-Prevent-overflow-on-32-bit-architectures.patch | 21 | ||||
-rw-r--r-- | debian/patches/series | 1 |
3 files changed, 28 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog index 46c50d0..49a59e8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +ripser (1.1.20200206.286d36-2) unstable; urgency=medium + + * Add patch to prevent overflow on 32 bit architectures. + + -- Gard Spreemann <gspr@nonempty.org> Sun, 08 Mar 2020 15:15:35 +0100 + ripser (1.1.20200206.286d36-1) unstable; urgency=medium * Initial release. (Closes: #943817) diff --git a/debian/patches/0001-Prevent-overflow-on-32-bit-architectures.patch b/debian/patches/0001-Prevent-overflow-on-32-bit-architectures.patch new file mode 100644 index 0000000..01142f6 --- /dev/null +++ b/debian/patches/0001-Prevent-overflow-on-32-bit-architectures.patch @@ -0,0 +1,21 @@ +From: Gard Spreemann <gspr@nonempty.org> +Date: Sun, 8 Mar 2020 15:14:54 +0100 +Subject: Prevent overflow on 32 bit architectures. + +--- + ripser.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ripser.cpp b/ripser.cpp +index cd546e8..79e5c89 100644 +--- a/ripser.cpp ++++ b/ripser.cpp +@@ -80,7 +80,7 @@ static const std::string clear_line("\r\033[K"); + static const size_t num_coefficient_bits = 8; + + static const index_t max_simplex_index = +- (1l << (8 * sizeof(index_t) - 1 - num_coefficient_bits)) - 1; ++ ((index_t)1 << (8 * sizeof(index_t) - 1 - num_coefficient_bits)) - 1; + + void check_overflow(index_t i) { + if diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..99f050b --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +0001-Prevent-overflow-on-32-bit-architectures.patch |