Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove unwrap
  • Loading branch information
youknowone committed May 10, 2024
commit ed3060442fc8bafff4f1a9fe20823be85b6d5ac8
5 changes: 3 additions & 2 deletions compiler/codegen/src/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,13 +261,14 @@ impl Compiler {
.sub_tables
.remove(0);
// Push the next table onto the stack
let last_idx = self.symbol_table_stack.len();
self.symbol_table_stack.push(table);
self.symbol_table_stack.last().unwrap()
&self.symbol_table_stack[last_idx]
}

/// Pop the current symbol table off the stack
fn pop_symbol_table(&mut self) -> SymbolTable {
self.symbol_table_stack.pop().unwrap()
self.symbol_table_stack.pop().expect("compiler bug")
}

fn push_output(
Expand Down