Closed
Description
Bug report
Bug description:
In the function pylong_aslongandoverflow
cpython/Modules/_testlimitedcapi/long.c
Lines 621 to 632 in 3929af5
there is an assertion overflow == -1
when value == -1
. But this is not always true, like if arg
is NULL
.
Reproduce:
from test.support import import_helper
_testlimitedcapi = import_helper.import_module('_testlimitedcapi')
aslonglongandoverflow = _testlimitedcapi.pylong_aslonglongandoverflow
aslonglongandoverflow(None)
Result:
python: ../Modules/_testlimitedcapi/long.c:674: pylong_aslonglongandoverflow: Assertion `overflow == -1' failed.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
- gh-130824: Add tests for
NULL
inPyLong_*AndOverflow
functions #130828 - [3.13] gh-130824: Add tests for
NULL
inPyLong_*AndOverflow
functions (GH-130828) #130869 - gh-130824: Clean up test wrappers for PyLong_*AndOverflow functions #130871
- [3.12] gh-130824: Add tests for NULL in PyLong_*AndOverflow functions (GH-130828) #130876