Skip to content

Commit

Permalink
Kernel: Simplify process assertion checking if region is in range
Browse files Browse the repository at this point in the history
Let's use the helper function for this :)
  • Loading branch information
shannonbooth authored and awesomekling committed Mar 22, 2020
1 parent 81adefe commit 757c146
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Kernel/Process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
Expand Down

0 comments on commit 757c146

Please sign in to comment.