proposed_upstream__revlog_s390x_part2
authorDebian Python Team <team+python@tracker.debian.org>
Wed, 25 Aug 2021 17:54:04 +0000 (18:54 +0100)
committerJulien Cristau <jcristau@debian.org>
Wed, 25 Aug 2021 17:54:04 +0000 (18:54 +0100)
# HG changeset patch
# User Julien Cristau <jcristau@debian.org>
# Date 1629841355 -7200
#      Tue Aug 24 23:42:35 2021 +0200
# Branch stable
# Node ID 132819e1fa1565b45fc09093ebbfbe991b0a0f5d
# Parent  518dd67482c0bde8636d1a5e6f10cb369b522e1f
revlog: fix more type confusion in index_replace_sidedata_info (issue6580)

We were telling python that "rev" was a Py_ssize_t (via the "n" format),
but it was actually an int.

Differential Revision: https://phab.mercurial-scm.org/D11335

Gbp-Pq: Name proposed_upstream__revlog_s390x_part2.patch

mercurial/cext/revlog.c

index 1ea4d4f75799761b63a09e67bf8a8ed2d3e42410..9bc52d8284e5a49f9b9a3780382131106f1cc572 100644 (file)
@@ -535,7 +535,8 @@ static PyObject *index_append(indexObject *self, PyObject *obj)
 static PyObject *index_replace_sidedata_info(indexObject *self, PyObject *args)
 {
        uint64_t offset_flags, sidedata_offset;
-       int rev, sidedata_comp_len;
+       Py_ssize_t rev;
+       int sidedata_comp_len;
        char comp_mode;
        char *data;
 #if LONG_MAX == 0x7fffffffL