# HG changeset patch # User Ben Wing # Date 1263975904 21600 # Node ID b5ad8cf9f6e48e10af3bc6c37c92cfe3788ecd56 # Parent ea701c23ed84f9ac1d66cb6b7e66c8a32ff2ce5e fix dynarr-related crash apparently due to compiler bug -------------------- ChangeLog entries follow: -------------------- src/ChangeLog addition: 2010-01-20 Ben Wing * 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. diff -r ea701c23ed84 -r b5ad8cf9f6e4 src/ChangeLog --- 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 + + * 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 * console-impl.h (struct console_methods): diff -r ea701c23ed84 -r b5ad8cf9f6e4 src/lisp.h --- 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)