Fix error

This commit is contained in:
Alexey Milovidov 2021-12-24 07:28:51 +03:00
parent 6e09a2a642
commit a96b4d50d6

View File

@ -97,14 +97,14 @@ void updateResources(std::string_view name, const void * address, SymbolIndex::R
name = name.substr((name[0] == '_') + strlen("binary_"));
name = name.substr(0, name.size() - strlen("_start"));
resources[name] = std::string_view{char_address, 0};
resources.emplace(name, std::string_view{char_address, 0});
}
else if (name.ends_with("_end"))
{
name = name.substr((name[0] == '_') + strlen("binary_"));
name = name.substr(0, name.size() - strlen("_end"));
if (auto it = resources.find(name); it != resources.end())
if (auto it = resources.find(name); it != resources.end() && it->second.size() == 0)
{
auto start = it->second.data();
assert(char_address >= start);