aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/marshal.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-11-16 18:34:24 +0100
committerGitHub <noreply@github.com>2022-11-16 18:34:24 +0100
commit8211cf5d287acfd815b6a7f6471cdf83dcd2bb9b (patch)
tree510409237622aa30dfc6833602bdde97c578f2bb /Python/marshal.c
parent19c1462e8dca3319c8290e2edcce482bd18cb018 (diff)
downloadcpython-8211cf5d287acfd815b6a7f6471cdf83dcd2bb9b.tar.gz
cpython-8211cf5d287acfd815b6a7f6471cdf83dcd2bb9b.zip
gh-99300: Replace Py_INCREF() with Py_NewRef() (#99530)
Replace Py_INCREF() and Py_XINCREF() using a cast with Py_NewRef() and Py_XNewRef().
Diffstat (limited to 'Python/marshal.c')
-rw-r--r--Python/marshal.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/marshal.c b/Python/marshal.c
index d6cc04d6f2a..86cf57daa77 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -326,8 +326,8 @@ w_ref(PyObject *v, char *flag, WFILE *p)
goto err;
}
w = (int)s;
- Py_INCREF(v);
- if (_Py_hashtable_set(p->hashtable, v, (void *)(uintptr_t)w) < 0) {
+ if (_Py_hashtable_set(p->hashtable, Py_NewRef(v),
+ (void *)(uintptr_t)w) < 0) {
Py_DECREF(v);
goto err;
}