From 5fbec948d16f63c5847e8e27b4fafc9c081c76fd Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sun, 8 Mar 2026 14:44:12 +0100 Subject: [CHORE] Add conanfile.txt, update AUTHORS. Signed-off-by: Amlal El Mahrouss --- src/CompilerKit/src/Assemblers/Assembler+AMD64.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/CompilerKit/src/Assemblers/Assembler+AMD64.cpp b/src/CompilerKit/src/Assemblers/Assembler+AMD64.cpp index 3fbeb37..6ee1313 100644 --- a/src/CompilerKit/src/Assemblers/Assembler+AMD64.cpp +++ b/src/CompilerKit/src/Assemblers/Assembler+AMD64.cpp @@ -325,7 +325,7 @@ asm_fail_exit: ///////////////////////////////////////////////////////////////////////////////////////// -static bool asm_read_attributes(std::string line) { +static bool asm_read_attributes(CompilerKit::STLString line) { // extern_segment is the opposite of public_segment, it signals to the ld // that we need this symbol. if (CompilerKit::ast_find_needle(line, "extern_segment")) { @@ -624,8 +624,8 @@ bool CompilerKit::EncoderAMD64::WriteNumber(const std::size_t& pos, std::string& CompilerKit::NumberCast64 num = CompilerKit::NumberCast64(res); - for (char& i : num.number) { - kAppBytes.push_back(i); + for (auto& nidx : num.number) { + kAppBytes.push_back(nidx); } if (kVerbose) { @@ -952,9 +952,9 @@ bool CompilerKit::EncoderAMD64::WriteLine(CompilerKit::STLString line, CompilerK std::string memOperand = substr.substr(bracketStart + 1, bracketEnd - bracketStart - 1); // Register lookup table - struct RegInfo { - const char* name; - i64_byte_t code; + struct RegInfo final { + const char* name{}; + i64_byte_t code{}; }; RegInfo regs64[] = {{"rax", 0}, {"rcx", 1}, {"rdx", 2}, {"rbx", 3}, @@ -1003,6 +1003,7 @@ bool CompilerKit::EncoderAMD64::WriteLine(CompilerKit::STLString line, CompilerK // Find register in the other operand std::string otherOperand; + if (destIsMemory) { otherOperand = substr.substr(commaPos + 1); } else { @@ -1031,6 +1032,7 @@ bool CompilerKit::EncoderAMD64::WriteLine(CompilerKit::STLString line, CompilerK if (!foundReg) { // Check if it's an immediate value std::string immStr = otherOperand; + while (!immStr.empty() && (immStr[0] == ' ' || immStr[0] == '\t')) { immStr.erase(0, 1); } -- cgit v1.2.3