base: fix _sum_in_range in avl structure

Handles corner case when addr + size becomes exactly 0. Before the commit
the function returned that sum is not part of the range, which is wrong.

Issue #3111
This commit is contained in:
Alexander Boettcher 2019-04-04 14:17:36 +02:00 committed by Christian Helmuth
parent 812149ed29
commit d1f37e66eb
1 changed files with 1 additions and 1 deletions

View File

@ -48,7 +48,7 @@ class Genode::Allocator_avl_base : public Range_allocator
private:
static bool _sum_in_range(addr_t addr, addr_t offset) {
return (~0UL - addr > offset); }
return (addr + offset - 1) >= addr; }
/*
* Noncopyable