Skip to content

Commit

Permalink
Fix code generation of else-less if
Browse files Browse the repository at this point in the history
  • Loading branch information
mtshiba committed Aug 28, 2022
1 parent bff720a commit 356906a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions compiler/erg_compiler/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
Expand Down

0 comments on commit 356906a

Please sign in to comment.