Fix code generation of else-less if

This commit is contained in:
Shunsuke Shibayama 2022-08-28 11:45:02 +09:00
parent bff720ab9d
commit 356906a5fe

View file

@ -811,6 +811,8 @@ impl CodeGenerator {
// no else block
let idx_end = self.cur_block().lasti;
self.edit_code(idx_pop_jump_if_false + 1, idx_end / 2);
self.emit_load_const(ValueObj::None);
self.stack_dec();
self.stack_dec();
}
Ok(())