source: clfs-sysroot/patches/glibc-2.8-localedef_segfault-1.patch@ af447da

Last change on this file since af447da was 2270211, checked in by Joe Ciccone <jciccone@…>, 16 years ago

Update Patches in the book.

  • Property mode set to 100644
File size: 2.0 KB
RevLine 
[2270211]1Submitted By: Jim Gifford (patches at jg555 dot com)
2Date: 2007-05-19
3Initial Package Version: 2.6
4Origin: Debian
5Upstream Status: Unknown
6Description: 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
10
11 Rediffed for 2.8 by Joe Ciccone
12
13diff -Naur glibc-2.8.orig/locale/programs/3level.h glibc-2.8/locale/programs/3level.h
14--- glibc-2.8.orig/locale/programs/3level.h 2007-07-15 20:54:59.000000000 -0400
15+++ glibc-2.8/locale/programs/3level.h 2008-09-20 12:09:34.000000000 -0400
16@@ -203,6 +203,42 @@
17 }
18 }
19 }
20+
21+/* GCC ATM seems to do a poor job with pointers to nested functions passed
22+ to inlined functions. Help it a little bit with this hack. */
23+#define wchead_table_iterate(tp, fn) \
24+do \
25+ { \
26+ struct wchead_table *t = (tp); \
27+ uint32_t index1; \
28+ for (index1 = 0; index1 < t->level1_size; index1++) \
29+ { \
30+ uint32_t lookup1 = t->level1[index1]; \
31+ if (lookup1 != ((uint32_t) ~0)) \
32+ { \
33+ uint32_t lookup1_shifted = lookup1 << t->q; \
34+ uint32_t index2; \
35+ for (index2 = 0; index2 < (1 << t->q); index2++) \
36+ { \
37+ uint32_t lookup2 = t->level2[index2 + lookup1_shifted]; \
38+ if (lookup2 != ((uint32_t) ~0)) \
39+ { \
40+ uint32_t lookup2_shifted = lookup2 << t->p; \
41+ uint32_t index3; \
42+ for (index3 = 0; index3 < (1 << t->p); index3++) \
43+ { \
44+ struct element_t *lookup3 \
45+ = t->level3[index3 + lookup2_shifted]; \
46+ if (lookup3 != NULL) \
47+ fn ((((index1 << t->q) + index2) << t->p) + index3, \
48+ lookup3); \
49+ } \
50+ } \
51+ } \
52+ } \
53+ } \
54+ } while (0)
55+
56 #endif
57
58 #ifndef NO_FINALIZE
Note: See TracBrowser for help on using the repository browser.