Fix fasm error when enqueueing ints > 2^32

On x64 the only instruction supporting imm64 is mov rXX,
imm64 so there has to be a special case for those numbers
This commit is contained in:
0x4261756D 2023-12-23 22:01:06 +01:00
parent 1f78ad0a7f
commit 90d67867cc
1 changed files with 9 additions and 1 deletions

View File

@ -501,7 +501,15 @@ fn generate_assembly_linux_x64_block(operations: &Vec<Operation>, functions: &Ve
{
Datatype::Int =>
{
data.code += format!("\tmov qword [queue+8*r13], {}\n", value).as_str();
if value.parse::<i64>().unwrap() > u32::MAX as i64
{
data.code += format!("\tmov rax, {}\n", value).as_str();
data.code += "\tmov qword [queue+8*r13], rax\n";
}
else
{
data.code += format!("\tmov qword [queue+8*r13], {}\n", value).as_str();
}
}
Datatype::Bool =>
{