Skip to content

Commit

Permalink
Fixed definetly the bug, now no extra instruction is kept
Browse files Browse the repository at this point in the history
  • Loading branch information
Etto48 committed Jul 2, 2024
1 parent f5d489d commit 9cfad0e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/app/asm/assembly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ impl App {

loop {
if current_byte >= maximum_code_byte {
to_byte = maximum_code_byte.saturating_sub(1);
to_byte = maximum_code_byte;
break;
}
let bytes = &self.data.bytes[current_byte..maximum_code_byte];
Expand Down Expand Up @@ -363,7 +363,7 @@ impl App {
return;
}

let to_instruction = self.assembly_offsets[to_byte];
let to_instruction = self.assembly_offsets.get(to_byte).cloned().unwrap_or(self.assembly_instructions.len());

let mut original_instruction_count = 1;
let mut original_instruction_ip = self.assembly_offsets[from_byte];
Expand Down Expand Up @@ -396,6 +396,10 @@ impl App {
),
);
}
else
{
break;
}
}
for instruction in instructions.iter() {
if let AssemblyLine::Instruction(instruction_tag) = instruction {
Expand Down

0 comments on commit 9cfad0e

Please sign in to comment.