D3538: bdiff: fix yet more fallout from xdiff long/int64 conversion (issue5885)

jcristau (Julien Cristau) phabricator at mercurial-scm.org
Sat May 12 20:41:27 UTC 2018


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

REVISION SUMMARY
  "l" in Py_BuildValue's format string means long, so passing int64_t
  instead results in fireworks on 32bit architectures.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/cext/bdiff.c

CHANGE DETAILS

diff --git a/mercurial/cext/bdiff.c b/mercurial/cext/bdiff.c
--- a/mercurial/cext/bdiff.c
+++ b/mercurial/cext/bdiff.c
@@ -261,7 +261,7 @@
                          void *priv)
 {
 	PyObject *rl = (PyObject *)priv;
-	PyObject *m = Py_BuildValue("llll", a1, a2, b1, b2);
+	PyObject *m = Py_BuildValue("LLLL", a1, a2, b1, b2);
 	if (!m)
 		return -1;
 	if (PyList_Append(rl, m) != 0) {



To: jcristau, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list