summaryrefslogtreecommitdiff
path: root/Python/compile.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-12-24 10:35:59 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2015-12-24 10:35:59 +0200
commit585a1eed45faea53f836b1db2ac211d7f14b44c8 (patch)
tree3c5cfaf65c0c2b6a2daa08f73e73ae78b15bffa0 /Python/compile.c
parent6044fdd1b841003aeef3852ddc1fa922eaab5dbd (diff)
downloadcpython-585a1eed45faea53f836b1db2ac211d7f14b44c8.tar.gz
Issue #20440: Massive replacing unsafe attribute setting code with special
macro Py_SETREF.
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 4befaa78fc..7631f4e55a 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -1795,8 +1795,7 @@ compiler_class(struct compiler *c, stmt_ty s)
{
/* use the class name for name mangling */
Py_INCREF(s->v.ClassDef.name);
- Py_XDECREF(c->u->u_private);
- c->u->u_private = s->v.ClassDef.name;
+ Py_SETREF(c->u->u_private, s->v.ClassDef.name);
/* load (global) __name__ ... */
str = PyUnicode_InternFromString("__name__");
if (!str || !compiler_nameop(c, str, Load)) {