if (dictoffset == 0)
return NULL;
if (dictoffset < 0) {
- Py_ssize_t tsize;
- size_t size;
-
- tsize = ((PyVarObject *)obj)->ob_size;
- if (tsize < 0)
+ Py_ssize_t tsize = Py_SIZE(obj);
+ if (tsize < 0) {
tsize = -tsize;
- size = _PyObject_VAR_SIZE(tp, tsize);
+ }
+ size_t size = _PyObject_VAR_SIZE(tp, tsize);
dictoffset += (long)size;
_PyObject_ASSERT(obj, dictoffset > 0);
dictoffset = tp->tp_dictoffset;
if (dictoffset != 0) {
if (dictoffset < 0) {
- Py_ssize_t tsize;
- size_t size;
-
- tsize = ((PyVarObject *)obj)->ob_size;
- if (tsize < 0)
+ Py_ssize_t tsize = Py_SIZE(obj);
+ if (tsize < 0) {
tsize = -tsize;
- size = _PyObject_VAR_SIZE(tp, tsize);
+ }
+ size_t size = _PyObject_VAR_SIZE(tp, tsize);
_PyObject_ASSERT(obj, size <= PY_SSIZE_T_MAX);
dictoffset += (Py_ssize_t)size;