# HG changeset patch # User Matt Harbison # Date 2018-03-13 01:50:18 # Node ID d40b9e29c11454bc912458f73e9b402e852da31d # Parent 521f6c7e1756a266362e2674f4ef19612b262a94 xdiff: fix a hard crash on Windows The xdiff case of test-diff-antipatience.t started crashing in the C extension with 882657a9f768 (with 6a71a5ba666b backported so it compiles). There are a few more instances of 'long', but this resolves the crashing. diff --git a/mercurial/thirdparty/xdiff/xdiffi.c b/mercurial/thirdparty/xdiff/xdiffi.c --- a/mercurial/thirdparty/xdiff/xdiffi.c +++ b/mercurial/thirdparty/xdiff/xdiffi.c @@ -342,7 +342,7 @@ int xdl_do_diff(mmfile_t *mf1, mmfile_t * One is to store the forward path and one to store the backward path. */ ndiags = xe->xdf1.nreff + xe->xdf2.nreff + 3; - if (!(kvd = (int64_t *) xdl_malloc((2 * ndiags + 2) * sizeof(long)))) { + if (!(kvd = (int64_t *) xdl_malloc((2 * ndiags + 2) * sizeof(int64_t)))) { xdl_free_env(xe); return -1; diff --git a/mercurial/thirdparty/xdiff/xprepare.c b/mercurial/thirdparty/xdiff/xprepare.c --- a/mercurial/thirdparty/xdiff/xprepare.c +++ b/mercurial/thirdparty/xdiff/xprepare.c @@ -296,9 +296,9 @@ static int xdl_prepare_ctx(unsigned int goto abort; memset(rchg, 0, (nrec + 2) * sizeof(char)); - if (!(rindex = (int64_t *) xdl_malloc((nrec + 1) * sizeof(long)))) + if (!(rindex = (int64_t *) xdl_malloc((nrec + 1) * sizeof(int64_t)))) goto abort; - if (!(ha = (uint64_t *) xdl_malloc((nrec + 1) * sizeof(unsigned long)))) + if (!(ha = (uint64_t *) xdl_malloc((nrec + 1) * sizeof(uint64_t)))) goto abort; xdf->nrec = nrec;