diff options
| author | Eli Zaretskii | 2023-06-10 11:48:37 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2023-06-10 11:48:37 +0300 |
| commit | 3de8ed09ab46b9922e15aaf0cc8884b41087c996 (patch) | |
| tree | 0b2c921f6ba22464f501fd95064589b30d698e3b /src | |
| parent | 3c01060c02359e5b813979b7b950bf904c87dcfa (diff) | |
| download | emacs-3de8ed09ab46b9922e15aaf0cc8884b41087c996.tar.gz emacs-3de8ed09ab46b9922e15aaf0cc8884b41087c996.zip | |
Avoid infinite recursion in 'window_wants_header_line'
* src/window.c (null_header_line_format): Avoid infinite
recursion by disallowing :eval on recursive calls.
(Bug#63988)
Diffstat (limited to 'src')
| -rw-r--r-- | src/window.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/window.c b/src/window.c index 3802efb992a..e22fea0bb7a 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -5470,6 +5470,7 @@ window_wants_mode_line (struct window *w) | |||
| 5470 | && WINDOW_PIXEL_HEIGHT (w) > WINDOW_FRAME_LINE_HEIGHT (w)); | 5470 | && WINDOW_PIXEL_HEIGHT (w) > WINDOW_FRAME_LINE_HEIGHT (w)); |
| 5471 | } | 5471 | } |
| 5472 | 5472 | ||
| 5473 | static int header_line_eval_called = 0; | ||
| 5473 | 5474 | ||
| 5474 | /** | 5475 | /** |
| 5475 | * null_header_line_format: | 5476 | * null_header_line_format: |
| @@ -5497,9 +5498,18 @@ null_header_line_format (Lisp_Object fmt, struct frame *f) | |||
| 5497 | { | 5498 | { |
| 5498 | if (EQ (car, QCeval)) | 5499 | if (EQ (car, QCeval)) |
| 5499 | { | 5500 | { |
| 5501 | if (header_line_eval_called > 0) | ||
| 5502 | return false; | ||
| 5503 | eassert (header_line_eval_called == 0); | ||
| 5504 | header_line_eval_called++; | ||
| 5500 | val = safe_eval_inhibit_quit (XCAR (XCDR (fmt))); | 5505 | val = safe_eval_inhibit_quit (XCAR (XCDR (fmt))); |
| 5506 | header_line_eval_called--; | ||
| 5507 | eassert (header_line_eval_called == 0); | ||
| 5501 | if (!FRAME_LIVE_P (f)) | 5508 | if (!FRAME_LIVE_P (f)) |
| 5502 | signal_error (":eval deleted the frame being displayed", fmt); | 5509 | { |
| 5510 | header_line_eval_called = 0; | ||
| 5511 | signal_error (":eval deleted the frame being displayed", fmt); | ||
| 5512 | } | ||
| 5503 | return NILP (val); | 5513 | return NILP (val); |
| 5504 | } | 5514 | } |
| 5505 | val = find_symbol_value (car); | 5515 | val = find_symbol_value (car); |