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: evaluate constant division #909

Merged
merged 1 commit into from
Feb 24, 2023
Merged

fix: evaluate constant division #909

merged 1 commit into from
Feb 24, 2023

Conversation

guipublic
Copy link
Contributor

Description

Summary of changes

Fix constant division by evaluating it at compile time

Test additions / changes

The test that raised the error is too complex to be included as a unit test, although it is most certainly possible to get a simple test with some research, I don't think it matters considering the fix. For the record the constant value was coming from evaluating a condition with predicate.

Checklist

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt with default settings.
  • I have linked this PR to the issue(s) that it resolves.
  • I have reviewed the changes on GitHub, line by line.
  • I have ensured all changes are covered in the description.
  • This PR requires documentation updates when merged.

Additional context

The division by 0 panic should become a user error but it should be done when we refactor the acir_gen pass to add error handling.

@guipublic guipublic requested a review from kevaundray February 24, 2023 16:25
@guipublic guipublic changed the title evaluate constant division fix: evaluate constant division Feb 24, 2023
@kevaundray kevaundray enabled auto-merge February 24, 2023 17:27
@kevaundray kevaundray added this pull request to the merge queue Feb 24, 2023
Merged via the queue into master with commit b91307b Feb 24, 2023
@kevaundray kevaundray deleted the gd/fix_constant_div branch February 24, 2023 17:47
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.

3 participants