[issue25221] PyLong_FromLong() potentially returns irregular object when small_ints[] isn't used
s-wakaba
report at bugs.python.org
Wed Sep 23 19:23:52 CEST 2015
New submission from s-wakaba:
When compiling cpython with specifying NSMALLPOSINTS and NSMALLNEGINTS macros as zero to skip making small_ints[] array, like following command, process couldn't finish.
$ ./configure CPPFLAGS='-DNSMALLPOSINTS=0 -DNSMALLNEGINTS=0'
$ make
The reason looks a problem that PyLong_FromLong(0) returns irregular int object: Py_SIZE(zero_int) must be 0, but it becomes 1.
maybe this problem never appears in actual cases, but in "longobject.c", it still looks supported to compile without small_ints[].
I don't know it should be fixed or not. but, as a result, I could compile cpython after addition of one line like attached patch.
Could you confirm this point?
Thanks.
----------
components: Interpreter Core
files: longobject.c.patch
keywords: patch
messages: 251436
nosy: s-wakaba
priority: normal
severity: normal
status: open
title: PyLong_FromLong() potentially returns irregular object when small_ints[] isn't used
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file40555/longobject.c.patch
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25221>
_______________________________________
More information about the Python-bugs-list
mailing list