revlog_unsigned_char_fix
authorDebian Python Team <team+python@tracker.debian.org>
Thu, 24 Mar 2022 19:39:34 +0000 (19:39 +0000)
committerJulien Cristau <jcristau@debian.org>
Thu, 24 Mar 2022 19:39:34 +0000 (19:39 +0000)
# HG changeset patch
# User Julien Cristau <jcristau@debian.org>
# Date 1647277023 -3600
#      Mon Mar 14 17:57:03 2022 +0100
# Branch stable
# Node ID 9ce563fb2989eda394330d3a9d37a8a75995a304
# Parent  59be65b7cdfded782e992c9d2e5557a7e78be878
revlog: fix wrong type of rank_unknown variable

We treat "rank" as an int everywhere, but declare rank_unknown as a
char.  On architectures where char is signed, that works out ok, but
when char is unsigned, rank_unknown is 255 instead of -1.

Differential Revision: https://phab.mercurial-scm.org/D12374

Gbp-Pq: Name revlog_unsigned_char_fix.patch

mercurial/cext/revlog.c

index 44ca4e50ddfb876c3c05947d8820b4cd2410b3e2..099616074dec1eef48c128a01f2dc9d81d6879b9 100644 (file)
@@ -179,7 +179,7 @@ static const long entry_cl2_offset_rank = 69;
 /* next free offset: 73 */
 
 static const char comp_mode_inline = 2;
-static const char rank_unknown = -1;
+static const int rank_unknown = -1;
 
 static void raise_revlog_error(void)
 {