Skip to content

Fix concrete zero-modulus ADDMOD and MULMOD - #588

Open
DicksonWu654 wants to merge 1 commit into
a16z:mainfrom
DicksonWu654:fix/addmod-mulmod-zero-modulus
Open

Fix concrete zero-modulus ADDMOD and MULMOD#588
DicksonWu654 wants to merge 1 commit into
a16z:mainfrom
DicksonWu654:fix/addmod-mulmod-zero-modulus

Conversation

@DicksonWu654

Copy link
Copy Markdown

Summary

  • Return zero before the fully concrete ADDMOD and MULMOD paths evaluate Python modulo.
  • Add concrete opcode regression cases for a zero modulus.
  • Preserve the existing symbolic and nonzero concrete behavior.

Rationale

The EVM defines both ADDMOD and MULMOD to return zero when the modulus is zero. The symbolic path already follows this rule through the bit-vector modulo helper, but the all-concrete fast path evaluated % 0 and raised ZeroDivisionError.

Validation

  • Static diff/whitespace validation passed.
  • The new cases exercise the opcode path with fully concrete operands.
  • Executable tests, builds, package-manager commands, and hooks were not run locally; repository CI is expected to provide executable validation.

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.

1 participant