diff options
| author | Eli Zaretskii | 2017-12-23 13:59:07 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2017-12-23 13:59:07 +0200 |
| commit | 720ed0b5334c9667b2fdc4d3f5e8975865e9f962 (patch) | |
| tree | 3aef0a567f0633da4bf04b486a9273f15ac578ca /src | |
| parent | 9105c9aa3438773cf68cf40615b55db81d1e9480 (diff) | |
| download | emacs-720ed0b5334c9667b2fdc4d3f5e8975865e9f962.tar.gz emacs-720ed0b5334c9667b2fdc4d3f5e8975865e9f962.zip | |
Avoid crashes when ':eval' deletes our frame
* src/xdisp.c (display_mode_element): Signal an error if
':eval' somehow deletes the frame whose window we are
redisplaying. (Bug#29726)
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 538c3e6b87e..f6e98daa329 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -23685,6 +23685,14 @@ display_mode_element (struct it *it, int depth, int field_width, int precision, | |||
| 23685 | { | 23685 | { |
| 23686 | Lisp_Object spec; | 23686 | Lisp_Object spec; |
| 23687 | spec = safe__eval (true, XCAR (XCDR (elt))); | 23687 | spec = safe__eval (true, XCAR (XCDR (elt))); |
| 23688 | /* The :eval form could delete the frame stored in the | ||
| 23689 | iterator, which will cause a crash if we try to | ||
| 23690 | access faces and other fields (e.g., FRAME_KBOARD) | ||
| 23691 | on that frame. This is a nonsensical thing to do, | ||
| 23692 | and signaling an error from redisplay might be | ||
| 23693 | dangerous, but we cannot continue with an invalid frame. */ | ||
| 23694 | if (!FRAME_LIVE_P (it->f)) | ||
| 23695 | signal_error (":eval deleted the frame being displayed", elt); | ||
| 23688 | n += display_mode_element (it, depth, field_width - n, | 23696 | n += display_mode_element (it, depth, field_width - n, |
| 23689 | precision - n, spec, props, | 23697 | precision - n, spec, props, |
| 23690 | risky); | 23698 | risky); |