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

to_be_bytes broken with Message: ICE: should have slice capacity set for value vXX being stored at vXX+2 #4418

Closed
n4ru opened this issue Feb 24, 2024 · 0 comments · Fixed by #4496
Assignees
Labels
bug Something isn't working

Comments

@n4ru
Copy link
Contributor

n4ru commented Feb 24, 2024

Aim

Previously functioning code fails to compile after bumping up to v0.24. Minimal reproduction attached.

Expected Behavior

It should compile without error.

Bug

I don't know what the bug is ¯\(ツ)

Probably related to to_be_bytes though.

To Reproduce

fn main(
  x: Field
) {
    let mut crash = x.to_be_bytes(32);

    if (x != 0) {}
}

Project Impact

Blocker

Impact Context

No response

Workaround

None

Workaround Description

No response

Additional Context

No response

Installation Method

Binary (noirup default)

Nargo Version

noirc version = 0.24.0+601fd9afc502236af1db0c4492698ba2298c7501

NoirJS Version

0.24.0

Would you like to submit a PR for this Issue?

None

Support Needs

No response

@n4ru n4ru added the bug Something isn't working label Feb 24, 2024
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Feb 24, 2024
@vezenovm vezenovm self-assigned this Feb 26, 2024
@n4ru n4ru changed the title Message: ICE: should have slice capacity set for value vXX being stored at vXX+2 to_be_bytes broken with Message: ICE: should have slice capacity set for value vXX being stored at vXX+2 Feb 28, 2024
github-merge-queue bot pushed a commit that referenced this issue Mar 8, 2024
# Description

## Problem\*

Resolves #4418 

## Summary\*

We need to add handling for slices returned from `ToRadix` and `ToBits`.

~~This PR does two fixes.~~ 
EDIT: After moving to the iterative flattening appraoch w are now
accurately tracking slice capacities when they are the parameters of
blocks.

## Additional Context



## Documentation\*

Check one:
- [ ] 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.
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Mar 8, 2024
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
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants