aboutsummaryrefslogtreecommitdiffstats
path: root/src/keyboard.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/keyboard.c')
-rw-r--r--src/keyboard.c9
1 files changed, 8 insertions, 1 deletions
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);