[PATCH 1 of 5] cext: fix compilation failure in revlog on Windows

Martin von Zweigbergk martinvonz at google.com
Fri Aug 10 01:18:57 EDT 2018


Sorry about that. I also fixed it in D4166. I'd prefer if that gets
accepted instead since I'll be away for a week now and won't be able to
rebase my series if this patch gets queued.

On Thu, Aug 9, 2018, 22:01 Matt Harbison <mharbison72 at gmail.com> wrote:

> # HG changeset patch
> # User Matt Harbison <matt_harbison at yahoo.com>
> # Date 1533872514 14400
> #      Thu Aug 09 23:41:54 2018 -0400
> # Node ID 36b8875f1f317742e3914b1dacde6af73a15a045
> # Parent  751caa6a293664aa0296ab52f634872442f2bb5c
> cext: fix compilation failure in revlog on Windows
>
> diff --git a/mercurial/cext/revlog.c b/mercurial/cext/revlog.c
> --- a/mercurial/cext/revlog.c
> +++ b/mercurial/cext/revlog.c
> @@ -1139,6 +1139,8 @@ static int nt_shortest(nodetree *self, c
>  static int index_init_nt(indexObject *self)
>  {
>         if (self->nt == NULL) {
> +               unsigned capacity;
> +
>                 if ((size_t)self->raw_length > INT_MAX /
> sizeof(nodetreenode)) {
>                         PyErr_SetString(PyExc_ValueError, "overflow in
> index_init_nt");
>                         return -1;
> @@ -1148,7 +1150,7 @@ static int index_init_nt(indexObject *se
>                         PyErr_NoMemory();
>                         return -1;
>                 }
> -               unsigned capacity = (self->raw_length < 4 ? 4 :
> (int)self->raw_length / 2);
> +               capacity = (self->raw_length < 4 ? 4 :
> (int)self->raw_length / 2);
>                 if (nt_init(self->nt, self, capacity) == -1) {
>                         PyMem_Free(self->nt);
>                         self->nt = NULL;
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20180809/d9f60e5a/attachment.html>


More information about the Mercurial-devel mailing list