mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
bpo-39573: Use Py_SET_SIZE() function (GH-18402)
Replace direct acccess to PyVarObject.ob_size with usage of the Py_SET_SIZE() function.
This commit is contained in:
parent
de6f38db48
commit
60ac6ed557
16 changed files with 95 additions and 86 deletions
|
@ -2963,7 +2963,7 @@ _PyBytes_Resize(PyObject **pv, Py_ssize_t newsize)
|
|||
}
|
||||
_Py_NewReference(*pv);
|
||||
sv = (PyBytesObject *) *pv;
|
||||
Py_SIZE(sv) = newsize;
|
||||
Py_SET_SIZE(sv, newsize);
|
||||
sv->ob_sval[newsize] = '\0';
|
||||
sv->ob_shash = -1; /* invalidate cached hash value */
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue