Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(acvm): Clear ACIR call stack after successful circuit execution #5783

Merged
merged 2 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// The features being tested is using assert on brillig that is triggered through nested ACIR calls.
// We want to make sure we get a call stack from the original call in main to the failed assert.
fn main(x: Field) {
assert(1 == fold_conditional_wrapper(!x as bool));
assert(1 == fold_conditional_wrapper(x as bool));
}

Expand Down
4 changes: 4 additions & 0 deletions tooling/nargo/src/ops/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ impl<'a, F: AcirField, B: BlackBoxFunctionSolver<F>, E: ForeignCallExecutor<F>>
}
}
}
// Clear the call stack if we have succeeded in executing the circuit.
// This needs to be done or else all successful ACIR call stacks will also be
// included in a failure case.
self.call_stack.clear();

Ok(acvm.finalize())
}
Expand Down
Loading