[Request] [+ ] D11335: revlog: fix more type confusion in index_replace_sidedata_info (issue6580)

jcristau (Julien Cristau) phabricator at mercurial-scm.org
Tue Aug 24 21:45:22 UTC 2021


jcristau created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

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

REPOSITORY
  rHG Mercurial

BRANCH
  stable

REVISION DETAIL
  https://phab.mercurial-scm.org/D11335

AFFECTED FILES
  mercurial/cext/revlog.c

CHANGE DETAILS

diff --git a/mercurial/cext/revlog.c b/mercurial/cext/revlog.c
--- a/mercurial/cext/revlog.c
+++ b/mercurial/cext/revlog.c
@@ -535,7 +535,8 @@
 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



To: jcristau, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20210824/5ee38273/attachment.html>


More information about the Mercurial-patches mailing list