[issue46280] About vulnerabilities in Cpython native code

Raymond Hettinger report at bugs.python.org
Thu Jan 6 16:12:31 EST 2022


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

#632 should be left as is.  Technically, the second "field++" is a dead store.  However, it is harmless and has some advantages.  It keeps the the assignments parallel and it reduces the chance of introducing a new bug if a new field is added (i.e. like one of the reasons we use trailing commas on multiline dicts and lists).

    PyStructSequence_SET_ITEM(int_info, field++,
                              PyLong_FromLong(PyLong_SHIFT));
    PyStructSequence_SET_ITEM(int_info, field++,
                              PyLong_FromLong(sizeof(digit)));

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46280>
_______________________________________


More information about the Python-bugs-list mailing list