diff --git a/libevmjit/Cache.cpp b/libevmjit/Cache.cpp index f9ca47398..1265273f6 100644 --- a/libevmjit/Cache.cpp +++ b/libevmjit/Cache.cpp @@ -56,8 +56,8 @@ ObjectCache* Cache::getObjectCache() void ObjectCache::notifyObjectCompiled(llvm::Module const* _module, llvm::MemoryBuffer const* _object) { auto&& key = _module->getModuleIdentifier(); - auto obj = llvm::MemoryBuffer::getMemBufferCopy(_object->getBuffer()); - m_map.insert(std::make_pair(key, obj)); + std::unique_ptr obj(llvm::MemoryBuffer::getMemBufferCopy(_object->getBuffer())); + m_map.insert(std::make_pair(key, std::move(obj))); } llvm::MemoryBuffer* ObjectCache::getObject(llvm::Module const* _module) diff --git a/libevmjit/Cache.h b/libevmjit/Cache.h index 6d1585329..f56716de2 100644 --- a/libevmjit/Cache.h +++ b/libevmjit/Cache.h @@ -42,7 +42,7 @@ public: virtual llvm::MemoryBuffer* getObject(llvm::Module const* _module) final override; private: - std::unordered_map m_map; + std::unordered_map> m_map; };