Add not & Fix while, for codegen bugs

This commit is contained in:
Shunsuke Shibayama 2022-11-16 00:06:00 +09:00
parent 113e245478
commit 7b53015b04
7 changed files with 65 additions and 8 deletions

View file

@ -601,6 +601,9 @@ impl CodeObj {
Opcode311::POP_JUMP_FORWARD_IF_FALSE | Opcode311::POP_JUMP_FORWARD_IF_TRUE => {
write!(instrs, "{arg} (to {})", idx + *arg as usize * 2 + 2).unwrap();
}
Opcode311::POP_JUMP_BACKWARD_IF_FALSE | Opcode311::POP_JUMP_BACKWARD_IF_TRUE => {
write!(instrs, "{arg} (to {})", idx - *arg as usize * 2 + 2).unwrap();
}
Opcode311::JUMP_BACKWARD => {
write!(instrs, "{arg} (to {})", idx - *arg as usize * 2 + 2).unwrap();
}