Skip to content

nightly-2024-02-07: fix: Prevent debugger crashing on circuits with no opcodes (#4283)

Pre-release
Pre-release
Compare
Choose a tag to compare
@github-actions github-actions released this 07 Feb 02:09
· 1675 commits to master since this release
2e32845
# Description

## Problem\*

Resolves #4231

The REPL debugger is not handling the case when the compiled circuit has
no opcodes and since it assumes there will be some opcodes, it panics on
continue.

## Summary\*

With this PR, the REPL debugger will start in a "finished" stated in
those cases and the DAP will not start the main loop.

## Additional Context

This edge case is very unlikely to happen, especially after applying
#4185 which changes the default mode for the debugger to Brillig (seems
to generate at least a trampoline-like fragment even for empty programs)
and after the introduction of debugging instrumentation. Nevertheless it
will still be possible (eg. empty program and passing `--acir-mode`
option).

## Documentation\*

Check one:
- [X] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[Exceptional Case]** Documentation to be submitted in a separate
PR.

# PR Checklist\*

- [X] I have tested the changes locally.
- [X] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.