diff --git a/Utilities/JITLLVM.cpp b/Utilities/JITLLVM.cpp index e514f5c62c..e35f5f493a 100644 --- a/Utilities/JITLLVM.cpp +++ b/Utilities/JITLLVM.cpp @@ -388,6 +388,7 @@ public: auto buf = llvm::WritableMemoryBuffer::getNewUninitMemBuffer(cached.size()); cached.read(buf->getBufferStart(), buf->getBufferSize()); + return buf; } @@ -615,6 +616,12 @@ void jit_compiler::add(const std::string& path) { auto cache = ObjectCache::load(path); + if (!cache) + { + jit_log.error("ObjectCache: Failed to read file. (path='%s', error=%s)", path, fs::g_tls_error); + return; + } + if (auto object_file = llvm::object::ObjectFile::createObjectFile(*cache)) { m_engine->addObjectFile(llvm::object::OwningBinary(std::move(*object_file), std::move(cache)));