mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-19 03:06:39 +00:00
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:
parent
812149ed29
commit
d1f37e66eb
@ -48,7 +48,7 @@ class Genode::Allocator_avl_base : public Range_allocator
|
|||||||
private:
|
private:
|
||||||
|
|
||||||
static bool _sum_in_range(addr_t addr, addr_t offset) {
|
static bool _sum_in_range(addr_t addr, addr_t offset) {
|
||||||
return (~0UL - addr > offset); }
|
return (addr + offset - 1) >= addr; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Noncopyable
|
* Noncopyable
|
||||||
|
Loading…
Reference in New Issue
Block a user