[dune-common] 01/03: patch: Add correct offset for end of chunk
Ansgar Burchardt
ansgar at moszumanska.debian.org
Tue Nov 22 19:27:50 UTC 2016
This is an automated email from the git hooks/post-receive script.
ansgar pushed a commit to annotated tag debian/2.5.0.rc1-2
in repository dune-common.
commit 83df876a01c455ac4dc2ae47f623dc1418362bab
Author: Ansgar Burchardt <ansgar at debian.org>
Date: Tue Nov 22 20:17:23 2016 +0100
patch: Add correct offset for end of chunk
This should fix the build failure on 32bit architectures.
Bug: https://gitlab.dune-project.org/core/dune-common/merge_requests/181
---
.../0001-Add-correct-offset-for-end-of-chunk.patch | 36 ++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 37 insertions(+)
diff --git a/debian/patches/0001-Add-correct-offset-for-end-of-chunk.patch b/debian/patches/0001-Add-correct-offset-for-end-of-chunk.patch
new file mode 100644
index 0000000..1fea271
--- /dev/null
+++ b/debian/patches/0001-Add-correct-offset-for-end-of-chunk.patch
@@ -0,0 +1,36 @@
+From 040d2a87525568b69555bef24e232ef65cb94c6f Mon Sep 17 00:00:00 2001
+From: Ansgar Burchardt <Ansgar.Burchardt at tu-dresden.de>
+Date: Tue, 22 Nov 2016 15:58:17 +0100
+Subject: [PATCH] Add correct offset for end of chunk
+
+Using `¤t->chunk_ + x` will add `x * sizeof(current->chunk_)` to
+the pointer, but we only want to add `x`.
+
+Adding a much larger number still "works" on 64bit systems (although it
+does not perform the intended check). However on 32bit platforms this
+wraps (at least in the way used by sllisttest.cc) and the "end" of the
+chunk is suddenly before the beginning.
+
+Closes #57
+---
+ dune/common/poolallocator.hh | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/dune/common/poolallocator.hh b/dune/common/poolallocator.hh
+index e18439d..657d8d6 100644
+--- a/dune/common/poolallocator.hh
++++ b/dune/common/poolallocator.hh
+@@ -525,8 +525,8 @@ namespace Dune
+ #ifndef NDEBUG
+ Chunk* current=chunks_;
+ while(current) {
+- if(static_cast<void*>(¤t->chunk_)<=b &&
+- static_cast<void*>((¤t->chunk_)+chunkSize)>b)
++ if(static_cast<void*>(current->chunk_)<=b &&
++ static_cast<void*>(current->chunk_+chunkSize)>b)
+ break;
+ current=current->next_;
+ }
+--
+2.10.2
+
diff --git a/debian/patches/series b/debian/patches/series
index c1e38b1..ca5bfc6 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
soname.patch
skip-dirs-starting-with-dot.patch
rename-git-whitespace-hook.patch
+0001-Add-correct-offset-for-end-of-chunk.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/dune-common.git
More information about the debian-science-commits
mailing list