]> git.eshelyaron.com Git - emacs.git/commitdiff
* eval.c (Fbacktrace): Don't assume nargs fits in int.
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 27 Mar 2011 08:29:39 +0000 (01:29 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 27 Mar 2011 08:29:39 +0000 (01:29 -0700)
src/ChangeLog
src/eval.c

index 8704ba4b9041b2b00068b0e523316c6f175af289..57389f306be53fff3b841bcffaa92e5e8d0307d0 100644 (file)
@@ -1,5 +1,7 @@
 2011-03-27  Paul Eggert  <eggert@cs.ucla.edu>
 
+       * eval.c (Fbacktrace): Don't assume nargs fits in int.
+
        * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
 
        * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
index b9d9354f48a5fc4928fffd1c0bd1d0bd7090c8d3..b732cbc644aa99fb422f38d1a8052623d919649d 100644 (file)
@@ -3298,7 +3298,6 @@ Output stream used is value of `standard-output'.  */)
   (void)
 {
   register struct backtrace *backlist = backtrace_list;
-  register int i;
   Lisp_Object tail;
   Lisp_Object tem;
   struct gcpro gcpro1;
@@ -3325,9 +3324,10 @@ Output stream used is value of `standard-output'.  */)
          write_string ("(", -1);
          if (backlist->nargs == (size_t) MANY)
            {
+             int i;
              for (tail = *backlist->args, i = 0;
                   !NILP (tail);
-                  tail = Fcdr (tail), i++)
+                  tail = Fcdr (tail), i = 1)
                {
                  if (i) write_string (" ", -1);
                  Fprin1 (Fcar (tail), Qnil);
@@ -3335,6 +3335,7 @@ Output stream used is value of `standard-output'.  */)
            }
          else
            {
+             size_t i;
              for (i = 0; i < backlist->nargs; i++)
                {
                  if (i) write_string (" ", -1);