From 7878653e8dbd65d94ea8ea8bae6e0afd3c3d0af3 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Tue, 27 May 2025 23:02:19 +0200 Subject: fix: fix SEGFAULT on CxxDrv (AMD64), caused by a stack corruption. refactor: Refactor LibCompiler's codebase, deperecate older C compilers, and fully focusing on C++ now. Signed-off-by: Amlal El Mahrouss --- dev/LibCompiler/src/CodeGen.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'dev/LibCompiler/src/CodeGen.cc') diff --git a/dev/LibCompiler/src/CodeGen.cc b/dev/LibCompiler/src/CodeGen.cc index 31a809b..3f215c5 100644 --- a/dev/LibCompiler/src/CodeGen.cc +++ b/dev/LibCompiler/src/CodeGen.cc @@ -24,10 +24,9 @@ namespace LibCompiler { ///! @brief Compile for specific format (ELF, PEF, ZBIN) Int32 AssemblyFactory::Compile(STLString sourceFile, const Int32& arch) noexcept { - if (sourceFile.length() < 1 || !fMounted) return LIBCOMPILER_UNIMPLEMENTED; + if (sourceFile.length() < 1) return LIBCOMPILER_UNIMPLEMENTED; if (!fMounted) return LIBCOMPILER_UNIMPLEMENTED; - if (arch != fMounted->Arch()) return LIBCOMPILER_INVALID_ARCH; try { @@ -48,7 +47,7 @@ void AssemblyFactory::Mount(AssemblyInterface* mountPtr) noexcept { AssemblyInterface* AssemblyFactory::Unmount() noexcept { auto mount_prev = fMounted; - if (mount_prev) { + if (fMounted) { fMounted = nullptr; } -- cgit v1.2.3