LLVM: Do not crash on failure to create cache file

This commit is contained in:
Eladash 2021-03-01 15:11:01 +02:00 committed by Ivan
parent 930895a218
commit ff211a9508
1 changed files with 6 additions and 1 deletions

View File

@ -565,7 +565,12 @@ public:
}
}
fs::file(name, fs::rewrite).write(zbuf.get(), zsz - zs.avail_out);
if (!fs::write_file(name, fs::rewrite, zbuf.get(), zsz - zs.avail_out))
{
jit_log.error("LLVM: Failed to create module file: %s (%s)", name, fs::g_tls_error);
return;
}
jit_log.notice("LLVM: Created module: %s", _module->getName().data());
}