[PATCH][BZ 19084] Make sure _nl_value_type_LC_<category> arrays have correct size.
Mike Frysinger
vapier@gentoo.org
Sun Apr 10 04:28:00 GMT 2016
thanks, your explanation clears things up. your patch isn't related to
bug 19084 though as we discussed. i'm fine with this patch then. how
about this commit message though:
When constructing the locale arrays, we use categories.def with macros.
For stringarrays (like ABDAY_1), we end up only populating the first of
the array and leave holes for the rest (i.e. we omit ABDAY_2, etc...).
When there happen to be more items after it, things work out because we
implicitly pad out the array to cover the omitted elements. However,
if these elements are specified last, we don't pad things out, and the
internal checks reject the compiled locale.
For example, if ABDAY_1 came last, the array would look like:
static const enum value_type _nl_value_type_LC_TIME[] = {
...
[...ABDAY_1...] = stringarray,
};
Trying to index ABDAY_2 would now run off the end of the array.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20160410/bed66498/attachment.sig>
More information about the Libc-alpha
mailing list