Skip to content
Snippets Groups Projects
Commit f157ef8c authored by Ansgar Burchardt's avatar Ansgar Burchardt Committed by Carsten Gräser
Browse files

[release] debugallocator: use unsigned integer type for pointer arithmetic


ptrdiff_t is a signed integer type and so the expression
  (std::uintptr_t)(ptr) % page_size
could become a negative value. In this case the page_ptr would be the
address of the next page after the allocation.

This wrong behaviour could be observed on (32bit) PowerPC: here
ptr was 0xf78cfe00 and page_ptr was calculated as 0xf78d0000 instead
of the correct 0xf78c0000.

(cherry picked from commit 1659ea4b)
Signed-off-by: default avatarCarsten Gräser <graeser@dune-project.org>
parent 6f73da1f
Branches
Tags
1 merge request!2512017-05 merge of upstream repository
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment