summaryrefslogtreecommitdiffstats
path: root/Objects/stringobject.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-12-24 08:35:35 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-12-24 08:35:35 (GMT)
commit5951f2300f43d75d344d542e171daed47a0382a6 (patch)
tree2e173dda0c0d4c4bf887e8a6a309430d0d9cd5be /Objects/stringobject.c
parent6ed42ea08b3a961944e94f1dd941ffabc7657065 (diff)
downloadcpython-5951f2300f43d75d344d542e171daed47a0382a6.zip
cpython-5951f2300f43d75d344d542e171daed47a0382a6.tar.gz
cpython-5951f2300f43d75d344d542e171daed47a0382a6.tar.bz2
Issue #20440: Massive replacing unsafe attribute setting code with special
macro Py_SETREF.
Diffstat (limited to 'Objects/stringobject.c')
-rw-r--r--Objects/stringobject.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/Objects/stringobject.c b/Objects/stringobject.c
index 14c5177..f585ffc 100644
--- a/Objects/stringobject.c
+++ b/Objects/stringobject.c
@@ -3865,8 +3865,7 @@ PyString_Concat(register PyObject **pv, register PyObject *w)
return;
}
v = string_concat((PyStringObject *) *pv, w);
- Py_DECREF(*pv);
- *pv = v;
+ Py_SETREF(*pv, v);
}
void
@@ -4751,8 +4750,7 @@ PyString_InternInPlace(PyObject **p)
t = PyDict_GetItem(interned, (PyObject *)s);
if (t) {
Py_INCREF(t);
- Py_DECREF(*p);
- *p = t;
+ Py_SETREF(*p, t);
return;
}