diff --git a/dust-lang/src/compiler.rs b/dust-lang/src/compiler.rs index 662fe2e..ddc52f4 100644 --- a/dust-lang/src/compiler.rs +++ b/dust-lang/src/compiler.rs @@ -778,6 +778,8 @@ impl<'src> Compiler<'src> { }); } + if let Some([Operation::Test, Operation::Jump]) = self.get_last_operations() {} + let (argument, push_back) = self.handle_binary_argument(&left_instruction)?; if push_back { diff --git a/dust-lang/src/instruction/mod.rs b/dust-lang/src/instruction/mod.rs index e7c03f6..fa8a82a 100644 --- a/dust-lang/src/instruction/mod.rs +++ b/dust-lang/src/instruction/mod.rs @@ -686,10 +686,10 @@ impl Instruction { function, argument_count, } = Call::from(self); - let first_argument = destination.index().saturating_sub(argument_count); - let last_argument = destination.index() - 1; + let arguments_start = destination.index().saturating_sub(argument_count); + let arguments_end = arguments_start + argument_count; - format!("{destination} = {function}(R{first_argument}..=R{last_argument})") + format!("{destination} = {function}(R{arguments_start}..R{arguments_end})") } Operation::CallNative => { let CallNative { @@ -697,10 +697,10 @@ impl Instruction { function, argument_count, } = CallNative::from(self); - let first_argument = destination.index().saturating_sub(argument_count); - let last_argument = destination.index() - 1; + let arguments_start = destination.index().saturating_sub(argument_count); + let arguments_end = arguments_start + argument_count; - format!("{destination} = {function}(R{first_argument}..=R{last_argument})") + format!("{destination} = {function}(R{arguments_start}..R{arguments_end})") } Operation::Return => { let Return { diff --git a/dust-lang/src/native_function/logic.rs b/dust-lang/src/native_function/logic.rs index b250fc1..1dae66d 100644 --- a/dust-lang/src/native_function/logic.rs +++ b/dust-lang/src/native_function/logic.rs @@ -104,10 +104,6 @@ pub fn write<'a>(vm: &'a Vm<'a>, instruction: Instruction) -> Result(vm: &'a Vm<'a>, instruction: Instruction) -> Result