From: Andreas Schwab Date: Tue, 6 Oct 2015 09:47:07 +0000 (+0200) Subject: Don't use XFASTINT on a negative number X-Git-Tag: emacs-25.0.90~1218 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0befeb0b7f7492103aa3902146a891fbef9e7d21;p=emacs.git Don't use XFASTINT on a negative number * src/cmds.c (Fself_insert_command): Don't use XFASTINT on a negative number. (Bug#21633) --- diff --git a/src/cmds.c b/src/cmds.c index ccc68911624..39c5af99f5d 100644 --- a/src/cmds.c +++ b/src/cmds.c @@ -307,8 +307,8 @@ At the end, it runs `post-self-insert-hook'. */) { CHECK_NUMBER (n); - if (XFASTINT (n) < 0) - error ("Negative repetition argument %"pI"d", XFASTINT (n)); + if (XINT (n) < 0) + error ("Negative repetition argument %"pI"d", XINT (n)); if (XFASTINT (n) < 2) remove_excessive_undo_boundaries (); @@ -316,14 +316,15 @@ At the end, it runs `post-self-insert-hook'. */) /* Barf if the key that invoked this was not a character. */ if (!CHARACTERP (last_command_event)) bitch_at_user (); - else { - int character = translate_char (Vtranslation_table_for_input, - XINT (last_command_event)); - int val = internal_self_insert (character, XFASTINT (n)); - if (val == 2) - nonundocount = 0; - frame_make_pointer_invisible (SELECTED_FRAME ()); - } + else + { + int character = translate_char (Vtranslation_table_for_input, + XINT (last_command_event)); + int val = internal_self_insert (character, XFASTINT (n)); + if (val == 2) + nonundocount = 0; + frame_make_pointer_invisible (SELECTED_FRAME ()); + } return Qnil; }