# HG changeset patch # User Yuya Nishihara # Date 1446885800 -32400 # Node ID ce03e72837c6a69ae7379f97e33c584f9beb123d # Parent 10a1a4b3e775d6024a82937df6bcc4188a315124 parsers: fix width of datalen variable in fm1readmarkers Because parsers.c does not define PY_SSIZE_T_CLEAN, "s#" format requires (const char*, int), not (const char*, Py_ssize_t). https://docs.python.org/2/c-api/arg.html This error had no problem before 042344313939, where datalen wasn't used. But now fm1readmarkers() fails with "overflow in obsstore" on Python 2.6.9 (amd64) because upper bits of datalen seem to be filled with 1, making it a negative integer. This problem seems not visible on our Python 2.7 environment because upper bits happen to be filled with 0. diff -r 10a1a4b3e775 -r ce03e72837c6 mercurial/parsers.c --- a/mercurial/parsers.c Fri Nov 06 11:08:11 2015 -0500 +++ b/mercurial/parsers.c Sat Nov 07 17:43:20 2015 +0900 @@ -2692,7 +2692,7 @@ static PyObject *fm1readmarkers(PyObject *self, PyObject *args) { const char *data, *dataend; - Py_ssize_t datalen; + int datalen; Py_ssize_t offset, stop; PyObject *markers = NULL;