diff options
| author | shadchin <[email protected]> | 2026-02-07 19:56:35 +0300 |
|---|---|---|
| committer | shadchin <[email protected]> | 2026-02-07 20:23:53 +0300 |
| commit | 19d43a3e6fb4cb8ea11747d7d7bca7a3542fbb44 (patch) | |
| tree | 0b1418938140a0b6470953bef6069454ffdf1bd0 /contrib/tools/python3/Python/hamt.c | |
| parent | 0879409bfc0891ab8103828a3bdbf0e960475fec (diff) | |
Update Python 3 to 3.13.12
commit_hash:71d3efea437a769b2b7910d196120bb02587046e
Diffstat (limited to 'contrib/tools/python3/Python/hamt.c')
| -rw-r--r-- | contrib/tools/python3/Python/hamt.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/contrib/tools/python3/Python/hamt.c b/contrib/tools/python3/Python/hamt.c index 91abaecd3e7..a9f811f4422 100644 --- a/contrib/tools/python3/Python/hamt.c +++ b/contrib/tools/python3/Python/hamt.c @@ -2368,6 +2368,10 @@ _PyHamt_Eq(PyHamtObject *v, PyHamtObject *w) return 0; } + Py_INCREF(v); + Py_INCREF(w); + + int res = 1; PyHamtIteratorState iter; hamt_iter_t iter_res; hamt_find_t find_res; @@ -2383,25 +2387,38 @@ _PyHamt_Eq(PyHamtObject *v, PyHamtObject *w) find_res = hamt_find(w, v_key, &w_val); switch (find_res) { case F_ERROR: - return -1; + res = -1; + goto done; case F_NOT_FOUND: - return 0; + res = 0; + goto done; case F_FOUND: { + Py_INCREF(v_key); + Py_INCREF(v_val); + Py_INCREF(w_val); int cmp = PyObject_RichCompareBool(v_val, w_val, Py_EQ); + Py_DECREF(v_key); + Py_DECREF(v_val); + Py_DECREF(w_val); if (cmp < 0) { - return -1; + res = -1; + goto done; } if (cmp == 0) { - return 0; + res = 0; + goto done; } } } } } while (iter_res != I_END); - return 1; +done: + Py_DECREF(v); + Py_DECREF(w); + return res; } Py_ssize_t |
