diff --git a/src/compiler/compiler.rs b/src/compiler/compiler.rs index 1467ca5..6a6b03e 100644 --- a/src/compiler/compiler.rs +++ b/src/compiler/compiler.rs @@ -17,10 +17,7 @@ impl Compiler { parser.end(); return if !(parser.had_error) { - let block = parser.blocks.pop(); - #[cfg(feature = "disassemble")] - block.as_ref()?.disassemble_block(); - block + parser.blocks.pop() } else { None }; diff --git a/src/vm/virtual_machine.rs b/src/vm/virtual_machine.rs index e197dc1..fe05548 100644 --- a/src/vm/virtual_machine.rs +++ b/src/vm/virtual_machine.rs @@ -38,9 +38,9 @@ impl VirtualMachine { #[inline(always)] fn run(&mut self, mut block: Block) -> Result { + #[cfg(feature = "disassemble")] + block.disassemble_block(); loop { - // #[cfg(feature = "disassemble")] - // block.disassemble_instruction(self.ip); match OpCode::from_u8(block.read_u8(self.ip)) { OpCode::Return => { let value = self.pop();