1 Submitted By: Jim Gifford (patches at jg555 dot com)
3 Initial Package Version: 2.6
5 Upstream Status: Unknown
6 Description: Fixes Segfault when using localdef.
7 This problem is only noticed when using PaX
8 and some architectures besides x86.
9 See debian bug # 231438
11 Rediffed for 2.8 by Joe Ciccone
12 Rediffed for 2.9 by Joe Ciccone
14 diff -Naur glibc-2.8.orig/locale/programs/3level.h glibc-2.8/locale/programs/3level.h
15 --- glibc-2.8.orig/locale/programs/3level.h 2007-07-15 20:54:59.000000000 -0400
16 +++ glibc-2.8/locale/programs/3level.h 2008-09-20 12:09:34.000000000 -0400
22 +/* GCC ATM seems to do a poor job with pointers to nested functions passed
23 + to inlined functions. Help it a little bit with this hack. */
24 +#define wchead_table_iterate(tp, fn) \
27 + struct wchead_table *t = (tp); \
29 + for (index1 = 0; index1 < t->level1_size; index1++) \
31 + uint32_t lookup1 = t->level1[index1]; \
32 + if (lookup1 != ((uint32_t) ~0)) \
34 + uint32_t lookup1_shifted = lookup1 << t->q; \
36 + for (index2 = 0; index2 < (1 << t->q); index2++) \
38 + uint32_t lookup2 = t->level2[index2 + lookup1_shifted]; \
39 + if (lookup2 != ((uint32_t) ~0)) \
41 + uint32_t lookup2_shifted = lookup2 << t->p; \
43 + for (index3 = 0; index3 < (1 << t->p); index3++) \
45 + struct element_t *lookup3 \
46 + = t->level3[index3 + lookup2_shifted]; \
47 + if (lookup3 != NULL) \
48 + fn ((((index1 << t->q) + index2) << t->p) + index3, \