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

Debugger enters both the "then" and the "else" statement of a single "if" #5922

Open
nickysn opened this issue Sep 4, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@nickysn
Copy link
Contributor

nickysn commented Sep 4, 2024

Aim

Executing a noir program one statement at a time inside the debugger.

Expected Behavior

When stepping through an "if" conditional, it is expected that after evaluating the boolean condition, the debugger should step either inside the "then" statement, or inside the "else" statement, but not go through both.

Bug

In certain cases, the debugger steps inside the "then" statement first, then on the next step it goes inside the "else" statement. In reality, only the "else" statement should be executed (because the boolean condition of the "if" is false) and the debugger should not enter the "then" statement at all.

To Reproduce

  1. Extract the Noir project that demonstrates the bug:
    if_then_else_reduced.tar.gz
  2. start "nargo debug" inside the project directory
  3. type "next" 9 times until the "if" condition is highlighted:
    Screenshot from 2024-09-04 18-23-58
  4. type "next" one more time. The debugger enters the "then" statement (which is incorrect):
    Screenshot from 2024-09-04 18-24-50
  5. type "next" one more time. The debugger jumps inside the "else" statement:
    Screenshot from 2024-09-04 18-25-36

Workaround

None

Workaround Description

No response

Additional Context

No response

Project Impact

Nice-to-have

Blocker Context

No response

Nargo Version

No response

NoirJS Version

No response

Proving Backend Tooling & Version

No response

Would you like to submit a PR for this Issue?

None

Support Needs

No response

@nickysn nickysn added the bug Something isn't working label Sep 4, 2024
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Sep 4, 2024
@smanilov
Copy link

@anaPerezGhiglia , I think you might be interested in this issue, because of your comments on #5706

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants