diff options
author | Shannon Booth <shannon.ml.booth@gmail.com> | 2020-03-22 14:02:01 +1300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-03-22 08:51:40 +0100 |
commit | 757c14650f7db67dabfba0ad9490ea78faeef3fe (patch) | |
tree | 6f32bbe4413b96f6069b627234fd1be7a48f26da /Kernel | |
parent | 81adefef27283d6d0f0bcd88099e4f1076317ace (diff) | |
download | serenity-757c14650f7db67dabfba0ad9490ea78faeef3fe.zip |
Kernel: Simplify process assertion checking if region is in range
Let's use the helper function for this :)
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/Process.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index 625b2c3a41..38e1a96731 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -348,8 +348,7 @@ Vector<Region*, 2> Process::split_region_around_range(const Region& source_regio ASSERT(!remaining_ranges_after_unmap.is_empty()); auto make_replacement_region = [&](const Range& new_range) -> Region& { - ASSERT(new_range.base() >= old_region_range.base()); - ASSERT(new_range.end() <= old_region_range.end()); + ASSERT(old_region_range.contains(new_range)); size_t new_range_offset_in_vmobject = source_region.offset_in_vmobject() + (new_range.base().get() - old_region_range.base().get()); return allocate_split_region(source_region, new_range, new_range_offset_in_vmobject); }; |