diff options
| author | milk4sale <53350507+milk4sale@users.noreply.github.com> | 2026-11-24 16:31:06 -0600 |
|---|---|---|
| committer | milk4sale <53350507+milk4sale@users.noreply.github.com> | 2026-11-24 16:31:06 -0600 |
| commit | d366ee248992db80d03ac1e5ce323058c6ac9e5d (patch) | |
| tree | a5574bc7ace504306ca3c38db66f758f55af3aa9 /runtime/src/pe_loader.cpp | |
| parent | 50407827cd2cb73313c585cdf3d3d40ed7918bae (diff) | |
| parent | 68d1331e5fe9bb4c9d02deabeb5905e55c23b7c8 (diff) | |
Merge main into gpu-test/cmp-f64
Brings the branch up to date with main 68d1331e5. No conflicts; the merged tree was tested before the push (every standalone
test file under tests/ passes except tests/test_ci_registration.py, which fails on main alone since #930).
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Diffstat (limited to 'runtime/src/pe_loader.cpp')
| -rw-r--r-- | runtime/src/pe_loader.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/runtime/src/pe_loader.cpp b/runtime/src/pe_loader.cpp index c29a288a9..cc4ae88aa 100644 --- a/runtime/src/pe_loader.cpp +++ b/runtime/src/pe_loader.cpp | |||
| @@ -1094,6 +1094,7 @@ Loader::~Loader() { | |||
| 1094 | entry(m.base, DLL_PROCESS_DETACH, nullptr); // explicit unload; the return value is ignored | 1094 | entry(m.base, DLL_PROCESS_DETACH, nullptr); // explicit unload; the return value is ignored |
| 1095 | } | 1095 | } |
| 1096 | } | 1096 | } |
| 1097 | shims::remove_xmem_allocation_hooks(this); | ||
| 1097 | shims::remove_bundled_loader(this); | 1098 | shims::remove_bundled_loader(this); |
| 1098 | shims::remove_module_lookup(this); | 1099 | shims::remove_module_lookup(this); |
| 1099 | for (auto* m : order_) { | 1100 | for (auto* m : order_) { |
| @@ -1498,6 +1499,12 @@ Module& Loader::map_image(const std::filesystem::path& path, const std::string& | |||
| 1498 | // installed here, before bind_imports can return control to the caller and before any image code can run. | 1499 | // installed here, before bind_imports can return control to the caller and before any image code can run. |
| 1499 | initialize_tls(*m); | 1500 | initialize_tls(*m); |
| 1500 | parse_exports(*m); | 1501 | parse_exports(*m); |
| 1502 | if (auto it = m->exports.find("__XMemAllocationHooks__"); it != m->exports.end()) { | ||
| 1503 | const auto offset = static_cast<uint64_t>(static_cast<uint8_t*>(it->second) - m->base); | ||
| 1504 | if (offset <= m->size && m->size - offset >= sizeof(shims::XMemAllocationHooks)) { | ||
| 1505 | shims::add_xmem_allocation_hooks(this, static_cast<const shims::XMemAllocationHooks*>(it->second)); | ||
| 1506 | } | ||
| 1507 | } | ||
| 1501 | return *m; | 1508 | return *m; |
| 1502 | } | 1509 | } |
| 1503 | 1510 | ||