]> git.eshelyaron.com Git - emacs.git/commitdiff
* alloc.c (valid_lisp_object_p): Treat killed buffers,
authorDmitry Antipov <dmantipov@yandex.ru>
Wed, 5 Sep 2012 12:55:03 +0000 (16:55 +0400)
committerDmitry Antipov <dmantipov@yandex.ru>
Wed, 5 Sep 2012 12:55:03 +0000 (16:55 +0400)
buffer_defaults and buffer_local_symbols as valid objects.
Return special value to denote them.

src/ChangeLog
src/alloc.c

index cb4f1071c70057bd584d4ab0a76599ab8b630069..3d2e25f7828c8f27a5abd6f2d59820cd155dab59 100644 (file)
@@ -1,3 +1,9 @@
+2012-09-05  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * alloc.c (valid_lisp_object_p): Treat killed buffers,
+       buffer_defaults and buffer_local_symbols as valid objects.
+       Return special value to denote them.
+
 2012-09-05  Paul Eggert  <eggert@cs.ucla.edu>
 
        * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
index 157d3a1d7994bc85b6a84ac0d413eab84ddb2e23..80ab2d2cb978195ed1b5329b84205a1e51a1e77e 100644 (file)
@@ -4981,7 +4981,8 @@ valid_pointer_p (void *p)
 #endif
 }
 
-/* Return 1 if OBJ is a valid lisp object.
+/* Return 2 if OBJ is a killed or special buffer object.
+   Return 1 if OBJ is a valid lisp object.
    Return 0 if OBJ is NOT a valid lisp object.
    Return -1 if we cannot validate OBJ.
    This function can be quite slow,
@@ -5002,6 +5003,9 @@ valid_lisp_object_p (Lisp_Object obj)
   if (PURE_POINTER_P (p))
     return 1;
 
+  if (p == &buffer_defaults || p == &buffer_local_symbols)
+    return 2;
+
 #if !GC_MARK_STACK
   return valid_pointer_p (p);
 #else
@@ -5027,7 +5031,7 @@ valid_lisp_object_p (Lisp_Object obj)
       return 0;
 
     case MEM_TYPE_BUFFER:
-      return live_buffer_p (m, p);
+      return live_buffer_p (m, p) ? 1 : 2;
 
     case MEM_TYPE_CONS:
       return live_cons_p (m, p);