changeset 4929:b5ad8cf9f6e4

fix dynarr-related crash apparently due to compiler bug -------------------- ChangeLog entries follow: -------------------- src/ChangeLog addition: 2010-01-20 Ben Wing <ben@xemacs.org> * lisp.h: Disable error-checking code in Dynarr_at and related lookup functions. It leads to a crash in the glyph-cachels code under Cygwin 1.7 and GCC 3.4.4. I assume this is a compiler bug since the code in question doesn't (or shouldn't) modify anything. Changing the code from inline to non-inline didn't help.
author Ben Wing <ben@xemacs.org>
date Wed, 20 Jan 2010 02:25:04 -0600
parents ea701c23ed84
children 9f04877ce07e
files src/ChangeLog src/lisp.h
diffstat 2 files changed, 17 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Tue Jan 19 11:21:34 2010 -0600
+++ b/src/ChangeLog	Wed Jan 20 02:25:04 2010 -0600
@@ -1,3 +1,12 @@
+2010-01-20  Ben Wing  <ben@xemacs.org>
+
+	* lisp.h:
+	Disable error-checking code in Dynarr_at and related lookup
+	functions.  It leads to a crash in the glyph-cachels code under
+	Cygwin 1.7 and GCC 3.4.4.  I assume this is a compiler bug since
+	the code in question doesn't (or shouldn't) modify anything.
+	Changing the code from inline to non-inline didn't help.
+
 2010-01-19  Ben Wing  <ben@xemacs.org>
 
 	* console-impl.h (struct console_methods):
--- a/src/lisp.h	Tue Jan 19 11:21:34 2010 -0600
+++ b/src/lisp.h	Wed Jan 20 02:25:04 2010 -0600
@@ -1771,11 +1771,7 @@
   assert_at_line (pos >= 0 && pos < dy->largest, file, line);
   return pos;
 }
-#else
-#define Dynarr_verify_pos(d, pos, file, line) (pos)
-#endif /* ERROR_CHECK_TYPES */
-
-#ifdef ERROR_CHECK_TYPES
+
 DECLARE_INLINE_HEADER (
 int
 Dynarr_verify_pos_atp (void *d, int pos, const Ascbyte *file, int line)
@@ -1848,12 +1844,19 @@
 #define Dynarr_new2(dynarr_type, type) \
   ((dynarr_type *) Dynarr_newf (sizeof (type)))
 
+#ifdef ERROR_CHECK_TYPES_GCC_NOT_BROKEN
+/* Enabling this leads to crashes in Cygwin 1.7, gcc 3.4.4 */
 #define Dynarr_at(d, pos) \
   ((d)->base[Dynarr_verify_pos_at (d, pos, __FILE__, __LINE__)])
 #define Dynarr_atp_allow_end(d, pos) \
   (&((d)->base[Dynarr_verify_pos_atp_allow_end (d, pos, __FILE__, __LINE__)]))
 #define Dynarr_atp(d, pos) \
   (&((d)->base[Dynarr_verify_pos_atp (d, pos, __FILE__, __LINE__)]))
+#else
+#define Dynarr_at(d, pos) ((d)->base[pos])
+#define Dynarr_atp(d, pos) (&Dynarr_at (d, pos))
+#define Dynarr_atp_allow_end(d, pos) Dynarr_atp (d, pos)
+#endif
 
 /* Old #define Dynarr_atp(d, pos) (&Dynarr_at (d, pos)) */
 #define Dynarr_begin(d) Dynarr_atp (d, 0)