summaryrefslogtreecommitdiffstats
path: root/Modules/_decimal/_decimal.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-04-11 06:57:37 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-04-11 06:57:37 (GMT)
commit59865e7fe158bcedc0c2b6252593650b018cf738 (patch)
tree8c11c78ca7a4bb7defc9b37f45c1bf92242814c6 /Modules/_decimal/_decimal.c
parenta29f7204937dc2600f6cdf6af91ef0c30dba36dc (diff)
parent864b63c33f8f715121efeb9fce031f9c2534c27a (diff)
downloadcpython-59865e7fe158bcedc0c2b6252593650b018cf738.zip
cpython-59865e7fe158bcedc0c2b6252593650b018cf738.tar.gz
cpython-59865e7fe158bcedc0c2b6252593650b018cf738.tar.bz2
Issue #26200: Restored more safe usages of Py_SETREF.
Diffstat (limited to 'Modules/_decimal/_decimal.c')
-rw-r--r--Modules/_decimal/_decimal.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c
index 0c02d28..3c2ad85 100644
--- a/Modules/_decimal/_decimal.c
+++ b/Modules/_decimal/_decimal.c
@@ -3439,14 +3439,14 @@ dec_as_integer_ratio(PyObject *self, PyObject *args UNUSED)
goto error;
}
- Py_XSETREF(exponent, long_methods->nb_power(tmp, exponent, Py_None));
+ Py_SETREF(exponent, long_methods->nb_power(tmp, exponent, Py_None));
Py_DECREF(tmp);
if (exponent == NULL) {
goto error;
}
if (exp >= 0) {
- Py_XSETREF(numerator, long_methods->nb_multiply(numerator, exponent));
+ Py_SETREF(numerator, long_methods->nb_multiply(numerator, exponent));
if (numerator == NULL) {
goto error;
}
@@ -3462,8 +3462,8 @@ dec_as_integer_ratio(PyObject *self, PyObject *args UNUSED)
if (tmp == NULL) {
goto error;
}
- Py_XSETREF(numerator, long_methods->nb_floor_divide(numerator, tmp));
- Py_XSETREF(denominator, long_methods->nb_floor_divide(denominator, tmp));
+ Py_SETREF(numerator, long_methods->nb_floor_divide(numerator, tmp));
+ Py_SETREF(denominator, long_methods->nb_floor_divide(denominator, tmp));
Py_DECREF(tmp);
if (numerator == NULL || denominator == NULL) {
goto error;