mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-21 18:22:33 +01:00
LLVM: Fix nullptr deref when accessing broken cache files
This commit is contained in:
parent
a6b2bf69f1
commit
c556322fc5
@ -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<llvm::object::ObjectFile>(std::move(*object_file), std::move(cache)));
|
||||
|
Loading…
Reference in New Issue
Block a user