diff options
Diffstat (limited to 'runtime/src/pe_loader.cpp')
| -rw-r--r-- | runtime/src/pe_loader.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/src/pe_loader.cpp b/runtime/src/pe_loader.cpp index f894fcb43..c630c9abf 100644 --- a/runtime/src/pe_loader.cpp +++ b/runtime/src/pe_loader.cpp | |||
| @@ -630,7 +630,7 @@ void* Loader::resolve_module_export(void* module_handle, const std::string& sym, | |||
| 630 | } | 630 | } |
| 631 | 631 | ||
| 632 | bool Loader::find_address(uint64_t address, std::string& module, uint32_t& rva) const { | 632 | bool Loader::find_address(uint64_t address, std::string& module, uint32_t& rva) const { |
| 633 | std::lock_guard lock(ranges_mutex_); | 633 | std::shared_lock lock(ranges_mutex_); |
| 634 | for (const MappedRange& r : ranges_) { | 634 | for (const MappedRange& r : ranges_) { |
| 635 | if (address >= r.base && address - r.base < r.size) { | 635 | if (address >= r.base && address - r.base < r.size) { |
| 636 | module = r.name; | 636 | module = r.name; |
| @@ -772,7 +772,7 @@ Module& Loader::map_image(const std::filesystem::path& path) { | |||
| 772 | { | 772 | { |
| 773 | // From here an address inside the image names it. The memory stays until ~Loader, which unregisters the | 773 | // From here an address inside the image names it. The memory stays until ~Loader, which unregisters the |
| 774 | // lookup first. | 774 | // lookup first. |
| 775 | std::lock_guard lock(ranges_mutex_); | 775 | std::unique_lock lock(ranges_mutex_); |
| 776 | ranges_.push_back({reinterpret_cast<uint64_t>(m->base), m->size, m->name}); | 776 | ranges_.push_back({reinterpret_cast<uint64_t>(m->base), m->size, m->name}); |
| 777 | } | 777 | } |
| 778 | 778 | ||