GNU bug report logs - #15405
24.3; #[] freezes emacs

Previous Next

Package: emacs;

Reported by: Leo Liu <sdl.web <at> gmail.com>

Date: Wed, 18 Sep 2013 01:52:02 UTC

Severity: normal

Merged with 16512

Found in version 24.3

Fixed in version 24.4

Done: Barry OReilly <gundaetiapo <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #89 received at 15405 <at> debbugs.gnu.org (full text, mbox):

From: Barry OReilly <gundaetiapo <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Dmitry Antipov <dmantipov <at> yandex.ru>,
 15405 <at> debbugs.gnu.org, Leo Liu <sdl.web <at> gmail.com>, stephen.berman <at> gmx.net
Subject: Re: bug#15405: 24.3; #[] freezes emacs
Date: Wed, 25 Sep 2013 15:09:22 -0400
[Message part 1 (text/plain, inline)]
How's this?

Also, when I was looking over the vector alloc code, I found a case
where I think int should be size_t.

diff --git a/src/alloc.c b/src/alloc.c
index ca21ba2..5b63383 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -2889,7 +2889,7 @@ sweep_vectors (void)
                free_this_block = 1;
              else
                {
-                 int tmp;
+                 size_t tmp;
                  SETUP_ON_FREE_LIST (vector, total_bytes, tmp);
                }
            }
@@ -3132,6 +3132,8 @@ usage: (vector &rest OBJECTS)  */)
 void
 make_byte_code (struct Lisp_Vector *v)
 {
+  /* Don't allow the global zero_vector to become a byte code object. */
+  eassert(v->header.size!=0);
   if (v->header.size > 1 && STRINGP (v->u.contents[1])
       && STRING_MULTIBYTE (v->u.contents[1]))
     /* BYTECODE-STRING must have been produced by Emacs 20.2 or the
diff --git a/src/lread.c b/src/lread.c
index 017dfcb..fe2b92a 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -2597,7 +2597,10 @@ read1 (Lisp_Object readcharfun, int *pch, bool
first_in_list)
             build them using function calls.  */
          Lisp_Object tmp;
          tmp = read_vector (readcharfun, 1);
-         make_byte_code (XVECTOR (tmp));
+         struct Lisp_Vector* vec = XVECTOR (tmp);
+         if (vec->header.size==0)
+           invalid_syntax ("Empty byte-code object");
+         make_byte_code (vec);
          return tmp;
        }
       if (c == '(')
[Message part 2 (text/html, inline)]

This bug report was last modified 11 years and 121 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.