source: patches/glibc-2.9-localedef_segfault-1.patch@ 82c4aa0

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 82c4aa0 was dbb2738d, checked in by Joe Ciccone <jciccone@…>, 16 years ago

Update Patches.

  • Property mode set to 100644
File size: 2.1 KB
RevLine 
[69cde8d]1Submitted By: Jim Gifford (patches at jg555 dot com)
[44426cf]2Date: 2007-05-19
3Initial Package Version: 2.6
[69cde8d]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.
[175f4d65]9 See debian bug # 231438
[69cde8d]10
[175f4d65]11 Rediffed for 2.8 by Joe Ciccone
[dbb2738d]12 Rediffed for 2.9 by Joe Ciccone
[175f4d65]13
14diff -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
17@@ -203,6 +203,42 @@
[69cde8d]18 }
19 }
20 }
21+
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) \
25+do \
26+ { \
27+ struct wchead_table *t = (tp); \
28+ uint32_t index1; \
29+ for (index1 = 0; index1 < t->level1_size; index1++) \
30+ { \
31+ uint32_t lookup1 = t->level1[index1]; \
32+ if (lookup1 != ((uint32_t) ~0)) \
33+ { \
34+ uint32_t lookup1_shifted = lookup1 << t->q; \
35+ uint32_t index2; \
36+ for (index2 = 0; index2 < (1 << t->q); index2++) \
37+ { \
38+ uint32_t lookup2 = t->level2[index2 + lookup1_shifted]; \
39+ if (lookup2 != ((uint32_t) ~0)) \
40+ { \
41+ uint32_t lookup2_shifted = lookup2 << t->p; \
42+ uint32_t index3; \
43+ for (index3 = 0; index3 < (1 << t->p); index3++) \
44+ { \
45+ struct element_t *lookup3 \
46+ = t->level3[index3 + lookup2_shifted]; \
47+ if (lookup3 != NULL) \
48+ fn ((((index1 << t->q) + index2) << t->p) + index3, \
49+ lookup3); \
50+ } \
51+ } \
52+ } \
53+ } \
54+ } \
55+ } while (0)
56+
57 #endif
58
59 #ifndef NO_FINALIZE
Note: See TracBrowser for help on using the repository browser.