Skip to content

Commit

Permalink
Restore counters before returning the error. (#2399)
Browse files Browse the repository at this point in the history
This restores `self.symbol_counters` before the error is propagated
upwards. Without this, we get a panic at the `unwrap()` because the same
thing is probably done further up in the call chain.
  • Loading branch information
chriseth authored Jan 28, 2025
1 parent 52195d0 commit 9a85691
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pil-analyzer/src/pil_analyzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -488,9 +488,9 @@ impl PILAnalyzer {
let mut counters = self.symbol_counters.take().unwrap();
let items =
StatementProcessor::new(self.driver(), &mut counters, self.polynomial_degree)
.handle_statement(statement)?;
.handle_statement(statement);
self.symbol_counters = Some(counters);
for item in items {
for item in items? {
match item {
PILItem::Definition(symbol, value) => {
let name = symbol.absolute_name.clone();
Expand Down

0 comments on commit 9a85691

Please sign in to comment.