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

Improve error message for locals index being out of bound #1619

Open
plafer opened this issue Jan 10, 2025 · 0 comments · May be fixed by #1640
Open

Improve error message for locals index being out of bound #1619

plafer opened this issue Jan 10, 2025 · 0 comments · May be fixed by #1640
Labels
assembly Related to Miden assembly enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@plafer
Copy link
Contributor

plafer commented Jan 10, 2025

Currently, the following

proc.my_fn.3
  loc_loadw.0
end

(correctly) fails with the following error message

Failed to compile test source.:   x parameter value must be greater than or equal to 0 and less than or equal to 3, but was 4

We should improve the message by

  1. including the source mapping to point to the offending line in the code, and
  2. We should say "less than or equal to 0" rather than 3
  • 3 is technically correct since loc_loadw indices are forced to be multiples of 4. But it would be more user-friendly if the error also rounded down 3 to 0
@plafer plafer added enhancement New feature or request good first issue Good for newcomers assembly Related to Miden assembly labels Jan 10, 2025
@bobbinth bobbinth added this to the v0.13.0 milestone Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assembly Related to Miden assembly enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants