diff options
author | Jeff Epler <jepler@gmail.com> | 2025-07-19 11:24:34 -0500 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2025-07-28 23:58:46 +1000 |
commit | 062e82a7cd60165db7edd8ee32105ea19a31ae2f (patch) | |
tree | 840bece2d256b11b78c3b5f9cd52465532dddde2 /tests/basics/builtin_pow3_intbig.py | |
parent | ebc9525c953dfbb6c44ab99320b5278e4314dafe (diff) |
py/objint_mpz: Fix pow3 where third argument is zero.
This finding is based on fuzzing MicroPython. I manually minimized the
test case it provided.
Signed-off-by: Jeff Epler <jepler@gmail.com>
Diffstat (limited to 'tests/basics/builtin_pow3_intbig.py')
-rw-r--r-- | tests/basics/builtin_pow3_intbig.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/basics/builtin_pow3_intbig.py b/tests/basics/builtin_pow3_intbig.py index bedc8b36b..41d2acbc0 100644 --- a/tests/basics/builtin_pow3_intbig.py +++ b/tests/basics/builtin_pow3_intbig.py @@ -20,3 +20,8 @@ print(hex(pow(2, x-1, x))) # Should be 1, since x is prime print(hex(pow(y, x-1, x))) # Should be 1, since x is prime print(hex(pow(y, y-1, x))) # Should be a 'big value' print(hex(pow(y, y-1, y))) # Should be a 'big value' + +try: + print(pow(1, 2, 0)) +except ValueError: + print("ValueError") |