From 1e5392a4ae710486f77afb5898c552b5b0e85061 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Tue, 12 Nov 2019 16:44:30 +0100 Subject: Make sure buffer is live before retrieving underline properties (Bug#38038) * src/window.h (WINDOW_BUFFER_LOCAL_VALUE): New macro. * src/nsterm.m (ns_draw_text_decoration): * src/w32term.c (w32_draw_glyph_string): * src/xterm.c (x_draw_glyph_string): Make sure buffer is live before retrieving underline properties from it (Bug#38038). --- src/window.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/window.h') diff --git a/src/window.h b/src/window.h index 71946a56955..5b9a3140c8f 100644 --- a/src/window.h +++ b/src/window.h @@ -608,6 +608,13 @@ wset_next_buffers (struct window *w, Lisp_Object val) ? (W)->contents \ : Qnil) +/* Local value of variable V in window W's buffer. Nil if W has no + buffer. */ +#define WINDOW_BUFFER_LOCAL_VALUE(V, W) \ + (BUFFERP ((W)->contents) \ + ? buffer_local_value(V, (W)->contents) \ + : Qnil) + /* Return the canonical column width of the frame of window W. */ #define WINDOW_FRAME_COLUMN_WIDTH(W) \ (FRAME_COLUMN_WIDTH (WINDOW_XFRAME ((W)))) -- cgit v1.2.1