From 2fd6271bdc6c2382194cf79dd67a9482d152e94e Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Tue, 20 May 2025 15:53:46 +0200 Subject: feat(cxxdrv): Improving and patching C++'s driver segfault at exit. Signed-off-by: Amlal El Mahrouss --- dev/LibCompiler/src/AssemblyFactory+AssemblyInterface.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'dev/LibCompiler/src/AssemblyFactory+AssemblyInterface.cc') diff --git a/dev/LibCompiler/src/AssemblyFactory+AssemblyInterface.cc b/dev/LibCompiler/src/AssemblyFactory+AssemblyInterface.cc index 11655fb..e6072d9 100644 --- a/dev/LibCompiler/src/AssemblyFactory+AssemblyInterface.cc +++ b/dev/LibCompiler/src/AssemblyFactory+AssemblyInterface.cc @@ -28,7 +28,11 @@ Int32 AssemblyFactory::Compile(std::string sourceFile, const Int32& arch) noexce if (arch != fMounted->Arch()) return LIBCOMPILER_INVALID_ARCH; - return fMounted->CompileToFormat(sourceFile, arch); + try { + return fMounted->CompileToFormat(sourceFile, arch); + } catch (std::exception& e) { + return LIBCOMPILER_EXEC_ERROR; + } } ///! @brief mount assembly backend. -- cgit v1.2.3