emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r110562: Do not verify indirection co


From: Dmitry Antipov
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110562: Do not verify indirection counters of killed buffers (Bug#12579).
Date: Wed, 17 Oct 2012 08:58:15 +0400
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110562
committer: Dmitry Antipov <address@hidden>
branch nick: trunk
timestamp: Wed 2012-10-17 08:58:15 +0400
message:
  Do not verify indirection counters of killed buffers (Bug#12579).
  * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
  * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
modified:
  src/ChangeLog
  src/buffer.c
  src/buffer.h
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-10-16 07:56:44 +0000
+++ b/src/ChangeLog     2012-10-17 04:58:15 +0000
@@ -1,3 +1,9 @@
+2012-10-17  Dmitry Antipov  <address@hidden>
+
+       Do not verify indirection counters of killed buffers (Bug#12579).
+       * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
+       * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
+
 2012-10-16  Dmitry Antipov  <address@hidden>
 
        * alloc.c (Fmake_byte_code): Fix typo in comment.

=== modified file 'src/buffer.c'
--- a/src/buffer.c      2012-10-12 01:47:40 +0000
+++ b/src/buffer.c      2012-10-17 04:58:15 +0000
@@ -1663,18 +1663,11 @@
 void
 compact_buffer (struct buffer *buffer)
 {
-  /* Verify indirection counters.  */
-  if (buffer->base_buffer)
-    {
-      eassert (buffer->indirections == -1);
-      eassert (buffer->base_buffer->indirections > 0);
-    }
-  else
-    eassert (buffer->indirections >= 0);
+  BUFFER_CHECK_INDIRECTION (buffer);
 
   /* Skip dead buffers, indirect buffers and buffers
      which aren't changed since last compaction.  */
-  if (!NILP (buffer->INTERNAL_FIELD (name))
+  if (BUFFER_LIVE_P (buffer)
       && (buffer->base_buffer == NULL)
       && (buffer->text->compact != buffer->text->modiff))
     {
@@ -2114,6 +2107,8 @@
   if (current_buffer == b)
     return;
 
+  BUFFER_CHECK_INDIRECTION (b);
+  
   old_buf = current_buffer;
   current_buffer = b;
   last_known_column_point = -1;   /* invalidate indentation cache */

=== modified file 'src/buffer.h'
--- a/src/buffer.h      2012-09-11 04:22:03 +0000
+++ b/src/buffer.h      2012-10-17 04:58:15 +0000
@@ -963,6 +963,22 @@
 
 #define BUFFER_LIVE_P(b) (!NILP (BVAR (b, name)))
 
+/* Verify indirection counters.  */
+
+#define BUFFER_CHECK_INDIRECTION(b)                    \
+  do {                                                 \
+    if (BUFFER_LIVE_P (b))                             \
+    {                                                  \
+      if (b->base_buffer)                              \
+       {                                               \
+         eassert (b->indirections == -1);              \
+         eassert (b->base_buffer->indirections > 0);   \
+       }                                               \
+      else                                             \
+       eassert (b->indirections >= 0);                 \
+    }                                                  \
+  } while (0)
+
 /* Chain of all buffers, including killed ones.  */
 
 extern struct buffer *all_buffers;


reply via email to

[Prev in Thread] Current Thread [Next in Thread]