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

Expression inside lt triggers Stack Overflow Error #6150

Closed
MarkCampbell90 opened this issue Sep 25, 2024 · 0 comments · Fixed by #6180
Closed

Expression inside lt triggers Stack Overflow Error #6150

MarkCampbell90 opened this issue Sep 25, 2024 · 0 comments · Fixed by #6180
Labels
bug Something isn't working

Comments

@MarkCampbell90
Copy link

Aim

I want to executing following (already minimized) program:

pub fn main(input : Field) -> pub bool {
    input.lt((((((((((((((((((1))))))))))))))))))
}

If the expression is moved to a variable everything is fine:

pub fn main(input : Field) -> pub bool {
    let var : Field = (((((((((((((((((1)))))))))))))))));
    nput.lt(var)
}

I would be interested to know:

  • Is this a known limitation of the lt function?
  • Are there other limitations like this?

Expected Behavior

I expected expressions to behave similar everywhere in code, no matter if present in an assignment or as an argument to lt( ... ). Additionally, the expression depth limit seems very small in this particular case.

Bug

thread '<unknown>' has overflowed its stack
fatal runtime error: stack overflow
Aborted

To Reproduce

  1. create a noir / nargo project with the given content
  2. nargo execute

Workaround

None

Workaround Description

Assigning the expression to a variable before passing it to the lt function as argument.

Additional Context

No response

Project Impact

None

Blocker Context

No response

Nargo Version

nargo version = 0.34.0 noirc version = 0.34.0+e3cdebe515e4dc4ee6e16e01bd8af25135939798 (git version hash: e3cdebe, is dirty: false)

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

@MarkCampbell90 MarkCampbell90 added the bug Something isn't working label Sep 25, 2024
@asterite asterite mentioned this issue Oct 3, 2024
5 tasks
@TomAFrench TomAFrench linked a pull request Oct 7, 2024 that will close this issue
5 tasks
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: Done
Development

Successfully merging a pull request may close this issue.

1 participant