aboutsummaryrefslogtreecommitdiff
path: root/locale/programs
diff options
context:
space:
mode:
Diffstat (limited to 'locale/programs')
-rw-r--r--locale/programs/ld-collate.c12
-rw-r--r--locale/programs/ld-ctype.c10
2 files changed, 16 insertions, 6 deletions
diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c
index 125356dadb..95c4dd4dfa 100644
--- a/locale/programs/ld-collate.c
+++ b/locale/programs/ld-collate.c
@@ -2300,14 +2300,16 @@ collate_output (struct localedef_t *locale, struct charmap_t *charmap,
more information here. */
assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_HASH_SIZE));
iov[2 + cnt].iov_base = &collate->plane_size;
- iov[2 + cnt].iov_len = sizeof (collate->plane_size);
+ iov[2 + cnt].iov_len = sizeof (uint32_t);
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
+ assert (idx[cnt] % 4 == 0);
++cnt;
assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_HASH_LAYERS));
iov[2 + cnt].iov_base = &collate->plane_cnt;
iov[2 + cnt].iov_len = sizeof (collate->plane_cnt);
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
+ assert (idx[cnt] % 4 == 0);
++cnt;
/* Construct a table with the names. The size of the table is the same
@@ -2324,6 +2326,7 @@ collate_output (struct localedef_t *locale, struct charmap_t *charmap,
iov[2 + cnt].iov_base = names;
iov[2 + cnt].iov_len = table_size * sizeof (uint32_t);
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
+ assert (idx[cnt] % 4 == 0);
++cnt;
/* Since we are using the sign of an integer to mark indirection the
@@ -2511,6 +2514,7 @@ collate_output (struct localedef_t *locale, struct charmap_t *charmap,
iov[2 + cnt].iov_len = table_size * sizeof (uint32_t);
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
assert (iov[2 + cnt].iov_len % sizeof (int32_t) == 0);
+ assert (idx[cnt] % 4 == 0);
++cnt;
assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_WEIGHTWC));
@@ -2518,6 +2522,7 @@ collate_output (struct localedef_t *locale, struct charmap_t *charmap,
iov[2 + cnt].iov_base = obstack_finish (&weightpool);
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
assert (iov[2 + cnt].iov_len % sizeof (int32_t) == 0);
+ assert (idx[cnt] % 4 == 0);
++cnt;
assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_EXTRAWC));
@@ -2526,6 +2531,7 @@ collate_output (struct localedef_t *locale, struct charmap_t *charmap,
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
assert (iov[2 + cnt].iov_len % sizeof (int32_t) == 0);
assert (iov[2 + cnt].iov_len % sizeof (int32_t) == 0);
+ assert (idx[cnt] % 4 == 0);
++cnt;
assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_INDIRECTWC));
@@ -2533,6 +2539,7 @@ collate_output (struct localedef_t *locale, struct charmap_t *charmap,
iov[2 + cnt].iov_base = obstack_finish (&indirectpool);
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
assert (iov[2 + cnt].iov_len % sizeof (int32_t) == 0);
+ assert (idx[cnt] % 4 == 0);
++cnt;
@@ -2633,12 +2640,14 @@ collate_output (struct localedef_t *locale, struct charmap_t *charmap,
iov[2 + cnt].iov_base = &elem_size;
iov[2 + cnt].iov_len = sizeof (int32_t);
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
+ assert (idx[cnt] % 4 == 0);
++cnt;
assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_SYMB_TABLEMB));
iov[2 + cnt].iov_base = elem_table;
iov[2 + cnt].iov_len = elem_size * 2 * sizeof (int32_t);
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
+ assert (idx[cnt] % 4 == 0);
++cnt;
assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_SYMB_EXTRAMB));
@@ -2656,6 +2665,7 @@ collate_output (struct localedef_t *locale, struct charmap_t *charmap,
assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_COLLSEQWC));
iov[2 + cnt].iov_base = collate->wcseqorder;
iov[2 + cnt].iov_len = table_size * sizeof (uint32_t);
+ assert (idx[cnt] % 4 == 0);
++cnt;
assert (cnt == _NL_ITEM_INDEX (_NL_NUM_LC_COLLATE));
diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c
index 1c1c492cb0..f3edd6cbc0 100644
--- a/locale/programs/ld-ctype.c
+++ b/locale/programs/ld-ctype.c
@@ -838,7 +838,7 @@ ctype_output (struct localedef_t *locale, struct charmap_t *charmap,
{
static const char nulbytes[4] = { 0, 0, 0, 0 };
struct locale_ctype_t *ctype = locale->categories[LC_CTYPE].ctype;
- const size_t nelems = (_NL_ITEM_INDEX (_NL_NUM_LC_CTYPE)
+ const size_t nelems = (_NL_ITEM_INDEX (_NL_CTYPE_EXTRA_MAP_1)
+ (oldstyle_tables
? (ctype->map_collection_nr - 2)
: (ctype->nr_charclass + ctype->map_collection_nr)));
@@ -866,7 +866,7 @@ ctype_output (struct localedef_t *locale, struct charmap_t *charmap,
for (elem = 0; elem < nelems; ++elem)
{
- if (elem < _NL_ITEM_INDEX (_NL_NUM_LC_CTYPE))
+ if (elem < _NL_ITEM_INDEX (_NL_CTYPE_EXTRA_MAP_1))
switch (elem)
{
#define CTYPE_EMPTY(name) \
@@ -1155,7 +1155,7 @@ ctype_output (struct localedef_t *locale, struct charmap_t *charmap,
/* Handle extra maps. */
if (oldstyle_tables)
{
- size_t nr = (elem - _NL_ITEM_INDEX (_NL_NUM_LC_CTYPE)) + 2;
+ size_t nr = (elem - _NL_ITEM_INDEX (_NL_CTYPE_EXTRA_MAP_1)) + 2;
iov[2 + elem + offset].iov_base = ctype->map32[nr];
iov[2 + elem + offset].iov_len = ((ctype->plane_size
@@ -1166,7 +1166,7 @@ ctype_output (struct localedef_t *locale, struct charmap_t *charmap,
}
else
{
- size_t nr = elem - _NL_ITEM_INDEX (_NL_NUM_LC_CTYPE);
+ size_t nr = elem - _NL_ITEM_INDEX (_NL_CTYPE_EXTRA_MAP_1);
if (nr < ctype->nr_charclass)
{
iov[2 + elem + offset] = ctype->class_3level[nr];
@@ -4240,7 +4240,7 @@ Computing table size for character classes might take a while..."),
}
else
{
- ctype->class_offset = _NL_ITEM_INDEX (_NL_NUM_LC_CTYPE);
+ ctype->class_offset = _NL_ITEM_INDEX (_NL_CTYPE_EXTRA_MAP_1);
ctype->map_offset = ctype->class_offset + ctype->nr_charclass;
}