aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2013-05-04 13:19:13 +0300
committerEli Zaretskii2013-05-04 13:19:13 +0300
commit5bebd1866b19bba82bc8c030ab828a608e301be5 (patch)
tree129e66f75f66bbfdd156f955732179a6315707b3 /src
parentd74a158186bb0fa8e5bdbedb7754dd873abab9a9 (diff)
downloademacs-5bebd1866b19bba82bc8c030ab828a608e301be5.tar.gz
emacs-5bebd1866b19bba82bc8c030ab828a608e301be5.zip
Fix bug #14062 with assertion violations on MS-Windows.
src/dispextern.h (WINDOW_WANTS_HEADER_LINE_P): Verify that w->contents is a buffer before computing everything else. Use parentheses to disambiguate last part of the condition. src/w32fns.c (w32_wnd_proc): Remove temporary code used to trap assertion violations.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog9
-rw-r--r--src/dispextern.h15
-rw-r--r--src/w32fns.c20
3 files changed, 17 insertions, 27 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 4245a1f0256..325babb4d86 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,12 @@
12013-05-04 Eli Zaretskii <eliz@gnu.org>
2
3 * dispextern.h (WINDOW_WANTS_HEADER_LINE_P): Verify that
4 w->contents is a buffer before computing everything else. Use
5 parentheses to disambiguate last part of the condition.
6
7 * w32fns.c (w32_wnd_proc): Remove temporary code used to trap
8 assertion violations. (Bug#14062)
9
12013-05-01 David Reitter <david.reitter@gmail.com> 102013-05-01 David Reitter <david.reitter@gmail.com>
2 11
3 * nsfns.m (ns_tooltip): Initialize. 12 * nsfns.m (ns_tooltip): Initialize.
diff --git a/src/dispextern.h b/src/dispextern.h
index 5ce7b19f173..50a32ffaf8f 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1423,13 +1423,14 @@ struct glyph_string
1423/* Value is true if window W wants a header line. */ 1423/* Value is true if window W wants a header line. */
1424 1424
1425#define WINDOW_WANTS_HEADER_LINE_P(W) \ 1425#define WINDOW_WANTS_HEADER_LINE_P(W) \
1426 (!MINI_WINDOW_P ((W)) \ 1426 (BUFFERP ((W)->contents) \
1427 && !(W)->pseudo_window_p \ 1427 ? (!MINI_WINDOW_P ((W)) \
1428 && FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME ((W)))) \ 1428 && !(W)->pseudo_window_p \
1429 && BUFFERP ((W)->contents) \ 1429 && FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME ((W)))) \
1430 && !NILP (BVAR (XBUFFER ((W)->contents), header_line_format)) \ 1430 && !NILP (BVAR (XBUFFER ((W)->contents), header_line_format)) \
1431 && WINDOW_TOTAL_LINES (W) > 1 \ 1431 && WINDOW_TOTAL_LINES (W) > \
1432 + !NILP (BVAR (XBUFFER ((W)->contents), mode_line_format))) 1432 (1 + !NILP (BVAR (XBUFFER ((W)->contents), mode_line_format)))) \
1433 : 0)
1433 1434
1434/* Return proper value to be used as baseline offset of font that has 1435/* Return proper value to be used as baseline offset of font that has
1435 ASCENT and DESCENT to draw characters by the font at the vertical 1436 ASCENT and DESCENT to draw characters by the font at the vertical
diff --git a/src/w32fns.c b/src/w32fns.c
index 0785e685e6a..66581341478 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -3183,28 +3183,8 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
3183 form.ptCurrentPos.y = w32_system_caret_y; 3183 form.ptCurrentPos.y = w32_system_caret_y;
3184 3184
3185 form.rcArea.left = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, 0); 3185 form.rcArea.left = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, 0);
3186
3187#ifdef ENABLE_CHECKING
3188 /* Temporary code to catch crashes in computing form.rcArea.top. */
3189 eassert (FRAMEP (w->frame));
3190 eassert (BUFFERP (w->contents));
3191 {
3192 int wmbp = WINDOW_MENU_BAR_P (w);
3193 int wtbp = WINDOW_TOOL_BAR_P (w);
3194 struct frame *wf = WINDOW_XFRAME (w);
3195 int fibw = FRAME_INTERNAL_BORDER_WIDTH (wf);
3196 int wtel = WINDOW_TOP_EDGE_LINE (w);
3197 int wflh = FRAME_LINE_HEIGHT (wf);
3198 int wwhlp= WINDOW_WANTS_HEADER_LINE_P (w);
3199 int chlh = CURRENT_HEADER_LINE_HEIGHT (w);
3200 int whlh = (wwhlp ? chlh : 0);
3201
3202 form.rcArea.top = ((wmbp || wtbp) ? 0 : fibw) + wtel * wflh + whlh;
3203 }
3204#else
3205 form.rcArea.top = (WINDOW_TOP_EDGE_Y (w) 3186 form.rcArea.top = (WINDOW_TOP_EDGE_Y (w)
3206 + WINDOW_HEADER_LINE_HEIGHT (w)); 3187 + WINDOW_HEADER_LINE_HEIGHT (w));
3207#endif
3208 form.rcArea.right = (WINDOW_BOX_RIGHT_EDGE_X (w) 3188 form.rcArea.right = (WINDOW_BOX_RIGHT_EDGE_X (w)
3209 - WINDOW_RIGHT_MARGIN_WIDTH (w) 3189 - WINDOW_RIGHT_MARGIN_WIDTH (w)
3210 - WINDOW_RIGHT_FRINGE_WIDTH (w)); 3190 - WINDOW_RIGHT_FRINGE_WIDTH (w));