0.9.5 release plans
Jim Hague
jim.hague at acm.org
Tue Oct 23 07:26:56 CDT 2007
On Friday 19 October 2007 19:19:44 Matt Mackall wrote:
> On Fri, Oct 19, 2007 at 05:33:39PM +0000, Jim Hague wrote:
> > As to the other failures, both occur with 0.9.4. 'hg serve' won't
> > serving .bz2, though 'hg archive' will happily produce a tbz2.
I haven't got to the bottom of the 'hg serve' failure yet; still looking.
I have found the cause of the test-bdiff failure. In bdiff.c, calloc() is
sometimes called with 0 as the number of members requested. C99, Unix98 and
probably other standards say that in that case the return is
implementation-defined; it can be a zero-length memory block or NULL. AIX
with Visual Age returns NULL, while the code assumes that it will get a valid
pointer back. The following work-around changes the call to get a minimum of
1 element. test-bdiff then passes.
# HG changeset patch
# User Jim Hague <jim.hague at acm.org>
# Date 1193135964 0
# Node ID 3a50381c59174a501b12ba88a3780528ed8ab2ef
# Parent 67c2588fca4933339a0d78684dcabf4f62fbca76
[mq]: test-bdiff-calloc-size0
diff -r 67c2588fca49 -r 3a50381c5917 mercurial/bdiff.c
--- a/mercurial/bdiff.c Fri Oct 19 19:20:33 2007 +0000
+++ b/mercurial/bdiff.c Tue Oct 23 10:39:24 2007 +0000
@@ -245,7 +245,7 @@ static struct hunklist diff(struct line
/* allocate and fill arrays */
t = equatelines(a, an, b, bn);
- pos = (struct pos *)calloc(bn, sizeof(struct pos));
+ pos = (struct pos *)calloc((bn>0)?bn:1, sizeof(struct pos));
/* we can't have more matches than lines in the shorter file */
l.head = l.base = (struct hunk *)malloc(sizeof(struct hunk) *
((an<bn ? an:bn) + 1));
--
Jim Hague - jim.hague at acm.org Never trust a computer you can't lift.
More information about the Mercurial
mailing list