From 091adafaac52ff409790728af63cab19bd52fc8f Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 14 Jul 2014 12:07:54 -0700 Subject: [PATCH] * macros.c (Fstart_kbd_macro): Avoid need for overflow check. --- src/ChangeLog | 2 +- src/macros.c | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 75c2a01d2d2..53795742131 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,6 +1,6 @@ 2014-07-14 Paul Eggert - * 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. diff --git a/src/macros.c b/src/macros.c index 07667f09431..4730a8becc9 100644 --- a/src/macros.c +++ b/src/macros.c @@ -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, ¤t_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. */ -- 2.39.5