diff --git a/src/jvm.rs b/src/jvm.rs index 06a3e3e..1879548 100644 --- a/src/jvm.rs +++ b/src/jvm.rs @@ -765,6 +765,15 @@ impl JVM { } } + Instruction::BranchNegative(branch_offset) => { + let test_value = wrap_stackframe_error(class, method, frame.operand_stack.pop_int(0))?; + + if test_value < 0 { + frame.instruction_pointer -= offset as u32; + frame.instruction_pointer = if branch_offset < 0 { frame.instruction_pointer - branch_offset.abs() as u32} else { frame.instruction_pointer + branch_offset.abs() as u32}; + } + } + Instruction::BranchNonNull(branch_offset) => { let test_value = wrap_stackframe_error(class, method, frame.operand_stack.pop_reference(0))?;