diff options
| author | Paul Eggert | 2014-09-07 06:27:33 -0700 |
|---|---|---|
| committer | Paul Eggert | 2014-09-07 06:27:33 -0700 |
| commit | 2b95a8efed84d6ec8f178a3bfbbcbfdee3ab35ef (patch) | |
| tree | 9ce8332e5ecf65dc0cfc37f3f63c549c7051e95b /src | |
| parent | d3cb31cbdfa38a19e9517bf817f106ee82d62986 (diff) | |
| download | emacs-2b95a8efed84d6ec8f178a3bfbbcbfdee3ab35ef.tar.gz emacs-2b95a8efed84d6ec8f178a3bfbbcbfdee3ab35ef.zip | |
* keyboard.c (read_decoded_event_from_main_queue): Reinstitute alloca
here for destination buffer, to work around what appears to be a
bug in decode_coding_c_string when the source and destination are
both C strings.
* keyboard.c (echo_add_key, menu_bar_items, tool_bar_items)
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/keyboard.c | 9 |
2 files changed, 15 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 72bdb87fc70..e9c3fe0dea4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | 2014-09-07 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2014-09-07 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | * keyboard.c (read_decoded_event_from_main_queue): Reinstitute alloca | ||
| 4 | here for destination buffer, to work around what appears to be a | ||
| 5 | bug in decode_coding_c_string when the source and destination are | ||
| 6 | both C strings. | ||
| 7 | |||
| 3 | Use SAFE_ALLOCA etc. to avoid unbounded stack allocation (Bug#18410). | 8 | Use SAFE_ALLOCA etc. to avoid unbounded stack allocation (Bug#18410). |
| 4 | This follows up on the recent thread in emacs-devel on alloca; see: | 9 | This follows up on the recent thread in emacs-devel on alloca; see: |
| 5 | http://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00042.html | 10 | http://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00042.html |
| @@ -24,7 +29,8 @@ | |||
| 24 | * ftfont.c (ftfont_get_charset, ftfont_check_otf, ftfont_drive_otf): | 29 | * ftfont.c (ftfont_get_charset, ftfont_check_otf, ftfont_drive_otf): |
| 25 | * ftxfont.c (ftxfont_draw): | 30 | * ftxfont.c (ftxfont_draw): |
| 26 | * image.c (xbm_load, xpm_load, jpeg_load_body): | 31 | * image.c (xbm_load, xpm_load, jpeg_load_body): |
| 27 | * keyboard.c (echo_add_key, menu_bar_items, tool_bar_items): | 32 | * keyboard.c (echo_add_key, menu_bar_items, tool_bar_items) |
| 33 | |||
| 28 | * keymap.c (Fdescribe_buffer_bindings, describe_map): | 34 | * keymap.c (Fdescribe_buffer_bindings, describe_map): |
| 29 | * lread.c (openp): | 35 | * lread.c (openp): |
| 30 | * menu.c (digest_single_submenu, find_and_call_menu_selection) | 36 | * menu.c (digest_single_submenu, find_and_call_menu_selection) |
diff --git a/src/keyboard.c b/src/keyboard.c index 9e14560404b..eef0770684e 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -2362,7 +2362,14 @@ read_decoded_event_from_main_queue (struct timespec *end_time, | |||
| 2362 | if (meta_key != 2) | 2362 | if (meta_key != 2) |
| 2363 | for (i = 0; i < n; i++) | 2363 | for (i = 0; i < n; i++) |
| 2364 | src[i] &= ~0x80; | 2364 | src[i] &= ~0x80; |
| 2365 | coding->destination = dest; | 2365 | |
| 2366 | /* FIXME: For some reason decode_coding_c_string requires a | ||
| 2367 | fresh output buffer each time, and reusing the old buffer can | ||
| 2368 | make Emacs dump core. Avoid triggering the problem for now | ||
| 2369 | by allocating a new buffer each time through the loop. */ | ||
| 2370 | bool please_fixme = true; | ||
| 2371 | coding->destination = please_fixme ? alloca (n * 4) : dest; | ||
| 2372 | |||
| 2366 | coding->dst_bytes = n * 4; | 2373 | coding->dst_bytes = n * 4; |
| 2367 | decode_coding_c_string (coding, src, n, Qnil); | 2374 | decode_coding_c_string (coding, src, n, Qnil); |
| 2368 | eassert (coding->produced_char <= n); | 2375 | eassert (coding->produced_char <= n); |