From a96b4d50d693e4b29decf35544fe29c5976343e6 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Fri, 24 Dec 2021 07:28:51 +0300 Subject: [PATCH] Fix error --- src/Common/SymbolIndex.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Common/SymbolIndex.cpp b/src/Common/SymbolIndex.cpp index 8bf01e4356c..ce811055dde 100644 --- a/src/Common/SymbolIndex.cpp +++ b/src/Common/SymbolIndex.cpp @@ -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);