comparison src/lisp.h @ 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 ae81a2c00f4f
children 8b63e21b0436
comparison
equal deleted inserted replaced
4928:ea701c23ed84 4929:b5ad8cf9f6e4
1769 /* We use `largest', not `len', because the redisplay code often 1769 /* We use `largest', not `len', because the redisplay code often
1770 accesses stuff between len and largest. */ 1770 accesses stuff between len and largest. */
1771 assert_at_line (pos >= 0 && pos < dy->largest, file, line); 1771 assert_at_line (pos >= 0 && pos < dy->largest, file, line);
1772 return pos; 1772 return pos;
1773 } 1773 }
1774 #else 1774
1775 #define Dynarr_verify_pos(d, pos, file, line) (pos)
1776 #endif /* ERROR_CHECK_TYPES */
1777
1778 #ifdef ERROR_CHECK_TYPES
1779 DECLARE_INLINE_HEADER ( 1775 DECLARE_INLINE_HEADER (
1780 int 1776 int
1781 Dynarr_verify_pos_atp (void *d, int pos, const Ascbyte *file, int line) 1777 Dynarr_verify_pos_atp (void *d, int pos, const Ascbyte *file, int line)
1782 ) 1778 )
1783 { 1779 {
1846 #endif /* NEW_GC */ 1842 #endif /* NEW_GC */
1847 #define Dynarr_new(type) ((type##_dynarr *) Dynarr_newf (sizeof (type))) 1843 #define Dynarr_new(type) ((type##_dynarr *) Dynarr_newf (sizeof (type)))
1848 #define Dynarr_new2(dynarr_type, type) \ 1844 #define Dynarr_new2(dynarr_type, type) \
1849 ((dynarr_type *) Dynarr_newf (sizeof (type))) 1845 ((dynarr_type *) Dynarr_newf (sizeof (type)))
1850 1846
1847 #ifdef ERROR_CHECK_TYPES_GCC_NOT_BROKEN
1848 /* Enabling this leads to crashes in Cygwin 1.7, gcc 3.4.4 */
1851 #define Dynarr_at(d, pos) \ 1849 #define Dynarr_at(d, pos) \
1852 ((d)->base[Dynarr_verify_pos_at (d, pos, __FILE__, __LINE__)]) 1850 ((d)->base[Dynarr_verify_pos_at (d, pos, __FILE__, __LINE__)])
1853 #define Dynarr_atp_allow_end(d, pos) \ 1851 #define Dynarr_atp_allow_end(d, pos) \
1854 (&((d)->base[Dynarr_verify_pos_atp_allow_end (d, pos, __FILE__, __LINE__)])) 1852 (&((d)->base[Dynarr_verify_pos_atp_allow_end (d, pos, __FILE__, __LINE__)]))
1855 #define Dynarr_atp(d, pos) \ 1853 #define Dynarr_atp(d, pos) \
1856 (&((d)->base[Dynarr_verify_pos_atp (d, pos, __FILE__, __LINE__)])) 1854 (&((d)->base[Dynarr_verify_pos_atp (d, pos, __FILE__, __LINE__)]))
1855 #else
1856 #define Dynarr_at(d, pos) ((d)->base[pos])
1857 #define Dynarr_atp(d, pos) (&Dynarr_at (d, pos))
1858 #define Dynarr_atp_allow_end(d, pos) Dynarr_atp (d, pos)
1859 #endif
1857 1860
1858 /* Old #define Dynarr_atp(d, pos) (&Dynarr_at (d, pos)) */ 1861 /* Old #define Dynarr_atp(d, pos) (&Dynarr_at (d, pos)) */
1859 #define Dynarr_begin(d) Dynarr_atp (d, 0) 1862 #define Dynarr_begin(d) Dynarr_atp (d, 0)
1860 #define Dynarr_lastp(d) Dynarr_atp (d, Dynarr_length (d) - 1) 1863 #define Dynarr_lastp(d) Dynarr_atp (d, Dynarr_length (d) - 1)
1861 #define Dynarr_past_lastp(d) Dynarr_atp_allow_end (d, Dynarr_length (d)) 1864 #define Dynarr_past_lastp(d) Dynarr_atp_allow_end (d, Dynarr_length (d))