Commit 091adafa authored by Paul Eggert's avatar Paul Eggert
Browse files

* macros.c (Fstart_kbd_macro): Avoid need for overflow check.

parent 918be627
2014-07-14 Paul Eggert <eggert@cs.ucla.edu>
* macros.c (Fstart_kbd_macro): Simplify.
* macros.c (Fstart_kbd_macro): Avoid need for overflow check.
This works around a GCC compiler bug when Emacs is configured with
--enable-gcc-warnings.
......
......@@ -87,16 +87,13 @@ macro before appending to it. */)
/* Check the type of last-kbd-macro in case Lisp code changed it. */
len = CHECK_VECTOR_OR_STRING (KVAR (current_kboard, Vlast_kbd_macro));
if (INT_ADD_OVERFLOW (len, incr))
memory_full (SIZE_MAX);
/* Copy last-kbd-macro into the buffer, in case the Lisp code
has put another macro there. */
if (current_kboard->kbd_macro_bufsize < len + incr)
if (current_kboard->kbd_macro_bufsize - incr < len)
current_kboard->kbd_macro_buffer =
xpalloc (current_kboard->kbd_macro_buffer,
&current_kboard->kbd_macro_bufsize,
len + incr - current_kboard->kbd_macro_bufsize, -1,
len - current_kboard->kbd_macro_bufsize + incr, -1,
sizeof *current_kboard->kbd_macro_buffer);
/* Must convert meta modifier when copying string to vector. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment