From 5a57ade58ec5bee85db41b8ce1340ff077781b65 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Thu, 24 Dec 2015 10:35:59 +0200 Subject: Issue #20440: Massive replacing unsafe attribute setting code with special macro Py_SETREF. --- Python/compile.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Python/compile.c') diff --git a/Python/compile.c b/Python/compile.c index 4befaa78fc9..7631f4e55a8 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)) { -- cgit v1.2.3