upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/src/pe_loader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/src/pe_loader.cpp')
-rw-r--r--runtime/src/pe_loader.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/runtime/src/pe_loader.cpp b/runtime/src/pe_loader.cpp
index 3b43ea89a..f4ecc0de2 100644
--- a/runtime/src/pe_loader.cpp
+++ b/runtime/src/pe_loader.cpp
@@ -1021,6 +1021,7 @@ void Loader::parse_exports(Module& m) {
1021 // into the string, so forwarders are kept apart and followed when an import asks for one. 1021 // into the string, so forwarders are kept apart and followed when an import asks for one.
1022 const uint64_t dir_begin = dir.VirtualAddress, dir_end = dir_begin + dir.Size; 1022 const uint64_t dir_begin = dir.VirtualAddress, dir_end = dir_begin + dir.Size;
1023 auto add_export = [&](const std::string& key, uint32_t rva) { 1023 auto add_export = [&](const std::string& key, uint32_t rva) {
1024 if (!rva) return; // An unused address-table slot is absent even when a name refers to it.
1024 if (rva >= dir_begin && rva < dir_end) 1025 if (rva >= dir_begin && rva < dir_end)
1025 m.forwarders[key] = read_string(m.name, m.base, m.size, rva, "a forwarded export"); 1026 m.forwarders[key] = read_string(m.name, m.base, m.size, rva, "a forwarded export");
1026 else if (rva >= m.size) // base + rva would point past the mapping, and a caller would jump there 1027 else if (rva >= m.size) // base + rva would point past the mapping, and a caller would jump there