Commit 0fd11aa5 authored by Paul Eggert's avatar Paul Eggert
Browse files

*print.c (Fexternal_debugging_output): Use more-conservative overflow fix.

parent ee780401
...@@ -554,8 +554,7 @@ ...@@ -554,8 +554,7 @@
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts. Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
(PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough. (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
(printchar, strout): Use xpalloc to catch size calculation overflow. (printchar, strout): Use xpalloc to catch size calculation overflow.
(Fexternal_debugging_output): Use CHECK_CHARACTER, not CHECK_NUMBER, (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
to avoid mishandling large integers.
(print_error_message): Use SAFE_ALLOCA, not alloca. (print_error_message): Use SAFE_ALLOCA, not alloca.
(print_object): Use int, not EMACS_INT, where int is wide enough. (print_object): Use int, not EMACS_INT, where int is wide enough.
* process.c (Fdelete_process): Don't assume pid fits into EMACS_INT. * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
......
...@@ -716,8 +716,8 @@ You can call print while debugging emacs, and pass it this function ...@@ -716,8 +716,8 @@ You can call print while debugging emacs, and pass it this function
to make it write to the debugging output. */) to make it write to the debugging output. */)
(Lisp_Object character) (Lisp_Object character)
{ {
CHECK_CHARACTER (character); CHECK_NUMBER (character);
putc ((int) XINT (character), stderr); putc (XINT (character) & 0xFF, stderr);
#ifdef WINDOWSNT #ifdef WINDOWSNT
/* Send the output to a debugger (nothing happens if there isn't one). */ /* Send the output to a debugger (nothing happens if there isn't one). */
......
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