summaryrefslogtreecommitdiff
path: root/Userland/DevTools/UserspaceEmulator
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/DevTools/UserspaceEmulator')
-rw-r--r--Userland/DevTools/UserspaceEmulator/Emulator.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/Userland/DevTools/UserspaceEmulator/Emulator.cpp b/Userland/DevTools/UserspaceEmulator/Emulator.cpp
index 76ba17fabe..85b0d84234 100644
--- a/Userland/DevTools/UserspaceEmulator/Emulator.cpp
+++ b/Userland/DevTools/UserspaceEmulator/Emulator.cpp
@@ -378,13 +378,10 @@ Vector<FlatPtr> Emulator::raw_backtrace()
MmapRegion const* Emulator::find_text_region(FlatPtr address)
{
MmapRegion const* matching_region = nullptr;
- mmu().for_each_region([&](auto& region) {
- if (!is<MmapRegion>(region))
- return IterationDecision::Continue;
- auto const& mmap_region = static_cast<MmapRegion const&>(region);
- if (!(mmap_region.is_executable() && address >= mmap_region.base() && address < mmap_region.base() + mmap_region.size()))
+ mmu().for_each_region_of_type<MmapRegion>([&](auto& region) {
+ if (!(region.is_executable() && address >= region.base() && address < region.base() + region.size()))
return IterationDecision::Continue;
- matching_region = &mmap_region;
+ matching_region = &region;
return IterationDecision::Break;
});
return matching_region;