summaryrefslogtreecommitdiffhomepage
path: root/dev
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-03-25 20:34:13 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2025-03-25 20:34:13 +0100
commit337d36ee5f1f8376f3dcc863270bbe92fd7f8ca7 (patch)
tree78638ce3ca247f185d94cb4f7612c49d49265af5 /dev
parenta54afb132d4c1e71fc57425a25c68e9ca6053c9b (diff)
fix(linker): A critical fix regarding the output being repetadely
written on the file. refactor(NFC): Rename String.h to StringView.h Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev')
-rw-r--r--dev/LibCompiler/AAL/AssemblyInterface.h2
-rw-r--r--dev/LibCompiler/NFC/StringView.h (renamed from dev/LibCompiler/NFC/String.h)0
-rw-r--r--dev/LibCompiler/src/DynamicLinkerPEF.cc7
-rw-r--r--dev/LibCompiler/src/StringView.cc (renamed from dev/LibCompiler/src/String.cc)2
4 files changed, 5 insertions, 6 deletions
diff --git a/dev/LibCompiler/AAL/AssemblyInterface.h b/dev/LibCompiler/AAL/AssemblyInterface.h
index 8e46455..7e02e4f 100644
--- a/dev/LibCompiler/AAL/AssemblyInterface.h
+++ b/dev/LibCompiler/AAL/AssemblyInterface.h
@@ -8,7 +8,7 @@
#include <LibCompiler/Macros.h>
#include <LibCompiler/Defines.h>
-#include <LibCompiler/NFC/String.h>
+#include <LibCompiler/NFC/StringView.h>
#define ASSEMBLY_INTERFACE : public LibCompiler::AssemblyInterface
diff --git a/dev/LibCompiler/NFC/String.h b/dev/LibCompiler/NFC/StringView.h
index 51fb8b8..51fb8b8 100644
--- a/dev/LibCompiler/NFC/String.h
+++ b/dev/LibCompiler/NFC/StringView.h
diff --git a/dev/LibCompiler/src/DynamicLinkerPEF.cc b/dev/LibCompiler/src/DynamicLinkerPEF.cc
index 4a7bb49..924f587 100644
--- a/dev/LibCompiler/src/DynamicLinkerPEF.cc
+++ b/dev/LibCompiler/src/DynamicLinkerPEF.cc
@@ -411,10 +411,9 @@ LIBCOMPILER_MODULE(DynamicLinker64PEF)
reader_protocol.FP.seekg(std::streamsize(ae_header.fStartCode));
reader_protocol.FP.read(bytes.data(), std::streamsize(ae_header.fCodeSize));
- for (auto& byte : bytes)
- {
- kObjectBytes.push_back({.mBlob = bytes, .mOffset = ae_header.fStartCode});
- }
+ kObjectBytes.push_back({.mBlob = bytes, .mOffset = ae_header.fStartCode});
+
+ // Blob was written, close fp.
reader_protocol.FP.close();
diff --git a/dev/LibCompiler/src/String.cc b/dev/LibCompiler/src/StringView.cc
index 1ecbd7a..186d475 100644
--- a/dev/LibCompiler/src/String.cc
+++ b/dev/LibCompiler/src/StringView.cc
@@ -18,7 +18,7 @@
*
*/
-#include <LibCompiler/NFC/String.h>
+#include <LibCompiler/NFC/StringView.h>
namespace LibCompiler
{