- handle JIT errors in a more user-friendly fashion than aborting.

* use I_Error instead of I_FatalError to abort. I_FatalError is only for things that are not recoverable and should not be handled outside of error cleanup and rethrowing.
* only catch CRecoverableError in JitCompile. Everything else should fall through to the outermost catch block.
* Do not I_FatalError out after handling the exception locally. Just print an error and return null, indicating failure.
This commit is contained in:
Christoph Oelckers 2018-12-04 18:45:07 +01:00
commit d7da2d838f
5 changed files with 32 additions and 32 deletions

View file

@ -64,7 +64,7 @@ static TArray<uint16_t> CreateUnwindInfoWindows(asmjit::CCFunc *func)
FuncFrameLayout layout;
Error error = layout.init(func->getDetail(), func->getFrameInfo());
if (error != kErrorOk)
I_FatalError("FuncFrameLayout.init failed");
I_Error("FuncFrameLayout.init failed");
// We need a dummy emitter for instruction size calculations
CodeHolder code;
@ -275,7 +275,7 @@ void *AddJitFunction(asmjit::CodeHolder* code, asmjit::CCFunc *func)
BOOLEAN result = RtlAddFunctionTable(table, 1, (DWORD64)baseaddr);
JitFrames.Push((uint8_t*)table);
if (result == 0)
I_FatalError("RtlAddFunctionTable failed");
I_Error("RtlAddFunctionTable failed");
#endif
return p;
@ -549,7 +549,7 @@ static TArray<uint8_t> CreateUnwindInfoUnix(asmjit::CCFunc *func, unsigned int &
FuncFrameLayout layout;
Error error = layout.init(func->getDetail(), func->getFrameInfo());
if (error != kErrorOk)
I_FatalError("FuncFrameLayout.init failed");
I_Error("FuncFrameLayout.init failed");
// We need a dummy emitter for instruction size calculations
CodeHolder code;