1
0
mirror of git://projects.qi-hardware.com/xburst-tools.git synced 2024-11-26 23:56:15 +02:00
xburst-tools/toolchain/patches/glibc/glibc-2.6.1-localedef_segfault-1.patch

57 lines
2.0 KiB
Diff
Raw Normal View History

Submitted By: Jim Gifford (patches at jg555 dot com)
Date: 2007-05-19
Initial Package Version: 2.6
Origin: Debian
Upstream Status: Unknown
Description: Fixes Segfault when using localdef.
This problem is only noticed when using PaX
and some architectures besides x86.
See debian bug # 231438
diff -Naur glibc-2.6.orig/locale/programs/3level.h glibc-2.6/locale/programs/3level.h
--- glibc-2.6.orig/locale/programs/3level.h 2005-12-06 21:47:27.000000000 -0800
+++ glibc-2.6/locale/programs/3level.h 2007-05-19 13:38:01.000000000 -0700
@@ -202,6 +202,42 @@
}
}
}
+
+/* GCC ATM seems to do a poor job with pointers to nested functions passed
+ to inlined functions. Help it a little bit with this hack. */
+#define wchead_table_iterate(tp, fn) \
+do \
+ { \
+ struct wchead_table *t = (tp); \
+ uint32_t index1; \
+ for (index1 = 0; index1 < t->level1_size; index1++) \
+ { \
+ uint32_t lookup1 = t->level1[index1]; \
+ if (lookup1 != ((uint32_t) ~0)) \
+ { \
+ uint32_t lookup1_shifted = lookup1 << t->q; \
+ uint32_t index2; \
+ for (index2 = 0; index2 < (1 << t->q); index2++) \
+ { \
+ uint32_t lookup2 = t->level2[index2 + lookup1_shifted]; \
+ if (lookup2 != ((uint32_t) ~0)) \
+ { \
+ uint32_t lookup2_shifted = lookup2 << t->p; \
+ uint32_t index3; \
+ for (index3 = 0; index3 < (1 << t->p); index3++) \
+ { \
+ struct element_t *lookup3 \
+ = t->level3[index3 + lookup2_shifted]; \
+ if (lookup3 != NULL) \
+ fn ((((index1 << t->q) + index2) << t->p) + index3, \
+ lookup3); \
+ } \
+ } \
+ } \
+ } \
+ } \
+ } while (0)
+
#endif
#ifndef NO_FINALIZE