Skip to content

fix: Modulo with divisor of zero should fail constraints#2578

Merged
jfecher merged 1 commit intomasterfrom
mv/mod-by-zero-fix
Sep 6, 2023
Merged

fix: Modulo with divisor of zero should fail constraints#2578
jfecher merged 1 commit intomasterfrom
mv/mod-by-zero-fix

Conversation

@vezenovm
Copy link
Contributor

@vezenovm vezenovm commented Sep 6, 2023

Description

Problem*

Resolves #2572

Summary*

In PR #2475 we make sure that we have a constraint failure if we attempt to divide by zero. This required preventing simplifications even if both the lhs and rhs of a binary op are known so that we can fail when processing the ACIR opcodes.

This PR simply adds the modulus case for simplification.

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.

@jfecher jfecher added this pull request to the merge queue Sep 6, 2023
Merged via the queue into master with commit fe6e2e6 Sep 6, 2023
@jfecher jfecher deleted the mv/mod-by-zero-fix branch September 6, 2023 17:01
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.

"Unreachable" % can cause panics

2 participants