summaryrefslogtreecommitdiffstats
path: root/Modules/zlibmodule.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-12-27 13:44:33 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-12-27 13:44:33 (GMT)
commit726fc139a5f40d81a0013c856be1283da08de4a0 (patch)
tree7a7fe3b19e13842df5b5d45a8567fbfb5e7bbd75 /Modules/zlibmodule.c
parentbdb908ea5466bfa09869fd2e1e7f3b17fe0fb2ea (diff)
parent191321d11bc7e064e1a07830a43fa600de310e1b (diff)
downloadcpython-726fc139a5f40d81a0013c856be1283da08de4a0.zip
cpython-726fc139a5f40d81a0013c856be1283da08de4a0.tar.gz
cpython-726fc139a5f40d81a0013c856be1283da08de4a0.tar.bz2
Issue #20440: More use of Py_SETREF.
This patch is manually crafted and contains changes that couldn't be handled automatically.
Diffstat (limited to 'Modules/zlibmodule.c')
-rw-r--r--Modules/zlibmodule.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/Modules/zlibmodule.c b/Modules/zlibmodule.c
index 7d2f55a..ed4439d 100644
--- a/Modules/zlibmodule.c
+++ b/Modules/zlibmodule.c
@@ -961,14 +961,11 @@ zlib_Compress_copy_impl(compobject *self)
goto error;
}
Py_INCREF(self->unused_data);
+ Py_SETREF(retval->unused_data, self->unused_data);
Py_INCREF(self->unconsumed_tail);
+ Py_SETREF(retval->unconsumed_tail, self->unconsumed_tail);
Py_XINCREF(self->zdict);
- Py_XDECREF(retval->unused_data);
- Py_XDECREF(retval->unconsumed_tail);
- Py_XDECREF(retval->zdict);
- retval->unused_data = self->unused_data;
- retval->unconsumed_tail = self->unconsumed_tail;
- retval->zdict = self->zdict;
+ Py_SETREF(retval->zdict, self->zdict);
retval->eof = self->eof;
/* Mark it as being initialized */
@@ -1020,14 +1017,11 @@ zlib_Decompress_copy_impl(compobject *self)
}
Py_INCREF(self->unused_data);
+ Py_SETREF(retval->unused_data, self->unused_data);
Py_INCREF(self->unconsumed_tail);
+ Py_SETREF(retval->unconsumed_tail, self->unconsumed_tail);
Py_XINCREF(self->zdict);
- Py_XDECREF(retval->unused_data);
- Py_XDECREF(retval->unconsumed_tail);
- Py_XDECREF(retval->zdict);
- retval->unused_data = self->unused_data;
- retval->unconsumed_tail = self->unconsumed_tail;
- retval->zdict = self->zdict;
+ Py_SETREF(retval->zdict, self->zdict);
retval->eof = self->eof;
/* Mark it as being initialized */