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: Set location before cast instructions in SSA #2202

Merged
merged 1 commit into from
Aug 7, 2023
Merged

Conversation

jfecher
Copy link
Contributor

@jfecher jfecher commented Aug 7, 2023

Description

Problem*

Resolves #2193

Summary*

This PR fixes the crash and shortens the error message, but the error message is a bit confusing now for the code snippet from the issue since it is off by one:

error: 
  ┌─ /Users/jakefecher/Code/Noir/noir/short/src/main.nr:3:13
  │
3 │     assert((x as u253) < (y as u253));
  │             --------- Range constraint of 254 bits is too large for the Field size

Although since we actually do perform a range constraint to 254 bits during a euclidean division call I'm not sure of an obvious solution to make it less confusing.

Documentation

  • This PR requires documentation updates when merged.

    • I will submit a noir-lang/docs PR.
    • I will request for and support Dev Rel's help in documenting this PR.

Additional Context

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

@kevaundray kevaundray added this pull request to the merge queue Aug 7, 2023
Merged via the queue into master with commit a72cc96 Aug 7, 2023
@kevaundray kevaundray deleted the jf/fix-2193 branch August 7, 2023 19:44
TomAFrench added a commit that referenced this pull request Aug 7, 2023
* master:
  chore: dumb integration of binary constrain
  fix: Set location before cast instructions in SSA (#2202)
  fix: simplification of overflowing integer operations (#2153)
  feat: Optimize equality checks between a boolean and constant (#2201)
TomAFrench added a commit that referenced this pull request Aug 11, 2023
* master:
  fix: Set location before cast instructions in SSA (#2202)
  fix: simplification of overflowing integer operations (#2153)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panic when attempting to get location for RuntimeError::UnsupportedIntegerSize error
2 participants