bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#8623: 23.3.50; (woman "git-remote") crashes


From: Sven Joachim
Subject: bug#8623: 23.3.50; (woman "git-remote") crashes
Date: Sun, 08 May 2011 19:42:51 +0200
User-agent: Gnus/5.110017 (No Gnus v0.17) Emacs/23.3.50 (gnu/linux)

On 2011-05-08 18:34 +0200, Paul Eggert wrote:

> On 05/08/2011 04:50 AM, Sven Joachim wrote:
>> No, neither of them helps.
>
> OK, thanks, so instead of trying to hack around, we need to really fix
> the problem.
>
> What happens if you backport the patch in question?

Sans src/ChangeLog, I get merge conflicts in 15 files (trying with the
git mirror and "git cherry-pick", since I'm not familiar with bzr).
Haven't really looked any further.

> You wrote that it's an "exercise for the reader", but suppose you actually
> apply the patch with "patch", and try to build?  I normally don't
> mess with the emacs-23 branch (and when I tried, it didn't build for me,
> unfortunately; see Bug#8637), so it'd be helpful if you could report
> what the integration problems are here.

Well, here is the diff after the failed cherry-pick (leaving out
src/ChangeLog):


diff --cc src/alloc.c
index ad11e21,c9496ec..0000000
--- a/src/alloc.c
+++ b/src/alloc.c
@@@ -163,13 -146,12 +163,13 @@@ static __malloc_size_t bytes_used_when_
  #define UNMARK_STRING(S)      ((S)->size &= ~ARRAY_MARK_FLAG)
  #define STRING_MARKED_P(S)    (((S)->size & ARRAY_MARK_FLAG) != 0)
  
- #define VECTOR_MARK(V)                ((V)->size |= ARRAY_MARK_FLAG)
- #define VECTOR_UNMARK(V)      ((V)->size &= ~ARRAY_MARK_FLAG)
- #define VECTOR_MARKED_P(V)    (((V)->size & ARRAY_MARK_FLAG) != 0)
+ #define VECTOR_MARK(V)                ((V)->header.size |= ARRAY_MARK_FLAG)
+ #define VECTOR_UNMARK(V)      ((V)->header.size &= ~ARRAY_MARK_FLAG)
+ #define VECTOR_MARKED_P(V)    (((V)->header.size & ARRAY_MARK_FLAG) != 0)
  
 -/* Value is the number of bytes of S, a pointer to a struct Lisp_String.
 -   Be careful during GC, because S->size contains the mark bit for
 +/* Value is the number of bytes/chars of S, a pointer to a struct
 +   Lisp_String.  This must be used instead of STRING_BYTES (S) or
 +   S->size during GC, because S->size contains the mark bit for
     strings.  */
  
  #define GC_STRING_BYTES(S)    (STRING_BYTES (S))
@@@ -1151,8 -1055,9 +1151,14 @@@ allocate_buffer (
    struct buffer *b
      = (struct buffer *) lisp_malloc (sizeof (struct buffer),
                                     MEM_TYPE_BUFFER);
++<<<<<<< HEAD
 +  b->size = sizeof (struct buffer) / sizeof (EMACS_INT);
 +  XSETPVECTYPE (b, PVEC_BUFFER);
++=======
+   XSETPVECTYPESIZE (b, PVEC_BUFFER,
+                   ((sizeof (struct buffer) + sizeof (EMACS_INT) - 1)
+                    / sizeof (EMACS_INT)));
++>>>>>>> 1c05634... lisp.h: Fix a problem with aliasing and vector headers.
    return b;
  }
  
@@@ -2956,11 -2825,10 +2960,11 @@@ allocate_vectorlike (len
  /* Allocate a vector with NSLOTS slots.  */
  
  struct Lisp_Vector *
 -allocate_vector (EMACS_INT nslots)
 +allocate_vector (nslots)
 +     EMACS_INT nslots;
  {
    struct Lisp_Vector *v = allocate_vectorlike (nslots);
-   v->size = nslots;
+   v->header.size = nslots;
    return v;
  }
  
@@@ -4913,10 -4769,10 +4916,10 @@@ Does not copy symbols.  Copies strings 
    else if (COMPILEDP (obj) || VECTORP (obj))
      {
        register struct Lisp_Vector *vec;
 -      register EMACS_INT i;
 +      register int i;
        EMACS_INT size;
  
-       size = XVECTOR (obj)->size;
+       size = XVECTOR_SIZE (obj);
        if (size & PSEUDOVECTOR_FLAG)
        size &= PSEUDOVECTOR_SIZE_MASK;
        vec = XVECTOR (make_pure_vector (size));
@@@ -5182,9 -5049,9 +5185,9 @@@ returns nil, because real GC can't be d
          }
        /* Now that we have stripped the elements that need not be in the
           undo_list any more, we can finally mark the list.  */
 -      mark_object (nextb->BUFFER_INTERNAL_FIELD (undo_list));
 +      mark_object (nextb->undo_list);
  
-       nextb = nextb->next;
+       nextb = nextb->header.next.buffer;
        }
    }
  
@@@ -5355,14 -5220,13 +5358,19 @@@ int last_marked_index
     links of a list, in mark_object.  In debugging,
     the call to abort will hit a breakpoint.
     Normally this is zero and the check never goes off.  */
 -static size_t mark_object_loop_halt;
 +static int mark_object_loop_halt;
  
  static void
 -mark_vectorlike (struct Lisp_Vector *ptr)
 +mark_vectorlike (ptr)
 +     struct Lisp_Vector *ptr;
  {
++<<<<<<< HEAD
 +  register EMACS_INT size = ptr->size;
 +  register int i;
++=======
+   register EMACS_UINT size = ptr->header.size;
+   register EMACS_UINT i;
++>>>>>>> 1c05634... lisp.h: Fix a problem with aliasing and vector headers.
  
    eassert (!VECTOR_MARKED_P (ptr));
    VECTOR_MARK (ptr);          /* Else mark it */
@@@ -5382,11 -5246,10 +5390,16 @@@
     symbols.  */
  
  static void
 -mark_char_table (struct Lisp_Vector *ptr)
 +mark_char_table (ptr)
 +     struct Lisp_Vector *ptr;
  {
++<<<<<<< HEAD
 +  register EMACS_INT size = ptr->size & PSEUDOVECTOR_SIZE_MASK;
 +  register int i;
++=======
+   register EMACS_UINT size = ptr->header.size & PSEUDOVECTOR_SIZE_MASK;
+   register EMACS_UINT i;
++>>>>>>> 1c05634... lisp.h: Fix a problem with aliasing and vector headers.
  
    eassert (!VECTOR_MARKED_P (ptr));
    VECTOR_MARK (ptr);
@@@ -5516,8 -5377,8 +5529,13 @@@ mark_object (arg
           recursion there.  */
        {
          register struct Lisp_Vector *ptr = XVECTOR (obj);
++<<<<<<< HEAD
 +        register EMACS_INT size = ptr->size;
 +        register int i;
++=======
+         register EMACS_UINT size = ptr->header.size;
+         register EMACS_UINT i;
++>>>>>>> 1c05634... lisp.h: Fix a problem with aliasing and vector headers.
  
          CHECK_LIVE (live_vector_p);
          VECTOR_MARK (ptr);    /* Else mark it */
diff --cc src/buffer.c
index 076495c,6ced4fb..0000000
--- a/src/buffer.c
+++ b/src/buffer.c
@@@ -630,10 -585,10 +630,10 @@@ CLONE nil means the indirect buffer's s
  
    b->newline_cache = 0;
    b->width_run_cache = 0;
 -  BVAR (b, width_table) = Qnil;
 +  b->width_table = Qnil;
  
    /* Put this on the chain of all buffers including killed ones.  */
-   b->next = all_buffers;
+   b->header.next.buffer = all_buffers;
    all_buffers = b;
  
    name = Fcopy_sequence (name);
@@@ -1544,14 -1458,14 +1544,14 @@@ with SIGHUP.  */
  
        GCPRO1 (buffer);
  
-       for (other = all_buffers; other; other = other->next)
+       for (other = all_buffers; other; other = other->header.next.buffer)
        /* all_buffers contains dead buffers too;
           don't re-kill them.  */
 -      if (other->base_buffer == b && !NILP (BVAR (other, name)))
 +      if (other->base_buffer == b && !NILP (other->name))
          {
 -          Lisp_Object buf;
 -          XSETBUFFER (buf, other);
 -          Fkill_buffer (buf);
 +          Lisp_Object buffer;
 +          XSETBUFFER (buffer, other);
 +          Fkill_buffer (buffer);
          }
  
        UNGCPRO;
@@@ -2585,11 -2476,11 +2585,16 @@@ current buffer is cleared.  */
  
    /* Copy this buffer's new multibyte status
       into all of its indirect buffers.  */
++<<<<<<< HEAD
 +  for (other = all_buffers; other; other = other->next)
 +    if (other->base_buffer == current_buffer && !NILP (other->name))
++=======
+   for (other = all_buffers; other; other = other->header.next.buffer)
+     if (other->base_buffer == current_buffer && !NILP (BVAR (other, name)))
++>>>>>>> 1c05634... lisp.h: Fix a problem with aliasing and vector headers.
        {
 -      BVAR (other, enable_multibyte_characters)
 -        = BVAR (current_buffer, enable_multibyte_characters);
 +      other->enable_multibyte_characters
 +        = current_buffer->enable_multibyte_characters;
        other->prevent_redisplay_optimizations_p = 1;
        }
  
@@@ -4343,13 -4176,12 +4348,13 @@@ static int last_overlay_modification_ho
     to the end of last_overlay_modification_hooks.  */
  
  static void
 -add_overlay_mod_hooklist (Lisp_Object functionlist, Lisp_Object overlay)
 +add_overlay_mod_hooklist (functionlist, overlay)
 +     Lisp_Object functionlist, overlay;
  {
-   int oldsize = XVECTOR (last_overlay_modification_hooks)->size;
+   int oldsize = XVECTOR_SIZE (last_overlay_modification_hooks);
  
    if (last_overlay_modification_hooks_used == oldsize)
 -    last_overlay_modification_hooks = larger_vector
 +    last_overlay_modification_hooks = larger_vector 
        (last_overlay_modification_hooks, oldsize * 2, Qnil);
    ASET (last_overlay_modification_hooks, last_overlay_modification_hooks_used,
        functionlist); last_overlay_modification_hooks_used++;
diff --cc src/bytecode.c
index db80f5b,839e0f7..0000000
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@@ -437,6 -466,10 +437,13 @@@ If the third argument is incorrect, Ema
    CHECK_VECTOR (vector);
    CHECK_NUMBER (maxdepth);
  
++<<<<<<< HEAD
++=======
+ #ifdef BYTE_CODE_SAFE
+   const_length = XVECTOR_SIZE (vector);
+ #endif
+ 
++>>>>>>> 1c05634... lisp.h: Fix a problem with aliasing and vector headers.
    if (STRING_MULTIBYTE (bytestr))
      /* BYTESTR must have been produced by Emacs 20.2 or the earlier
         because they produced a raw 8-bit string for byte-code and now
diff --cc src/composite.c
index a9376c0,aa60900..0000000
--- a/src/composite.c
+++ b/src/composite.c
@@@ -300,7 -293,7 +300,11 @@@ get_composition_id (charpos, bytepos, n
      }
    else if (VECTORP (components) || CONSP (components))
      {
++<<<<<<< HEAD
 +      int len = XVECTOR (key)->size;
++=======
+       EMACS_UINT len = XVECTOR_SIZE (key);
++>>>>>>> 1c05634... lisp.h: Fix a problem with aliasing and vector headers.
  
        /* The number of elements should be odd.  */
        if ((len % 2) == 0)
diff --cc src/data.c
index 0c7cb24,68ea503..0000000
--- a/src/data.c
+++ b/src/data.c
@@@ -1378,53 -1336,70 +1378,67 @@@ DEFUN ("set-default", Fset_default, Sse
         doc: /* Set SYMBOL's default value to VALUE.  SYMBOL and VALUE are 
evaluated.
  The default value is seen in buffers that do not have their own values
  for this variable.  */)
 -  (Lisp_Object symbol, Lisp_Object value)
 +     (symbol, value)
 +     Lisp_Object symbol, value;
  {
 -  struct Lisp_Symbol *sym;
 +  register Lisp_Object valcontents, current_alist_element, 
alist_element_buffer;
  
    CHECK_SYMBOL (symbol);
 -  if (SYMBOL_CONSTANT_P (symbol))
 -    {
 -      if (NILP (Fkeywordp (symbol))
 -        || !EQ (value, Fdefault_value (symbol)))
 -      xsignal1 (Qsetting_constant, symbol);
 -      else
 -      /* Allow setting keywords to their own value.  */
 -      return value;
 -    }
 -  sym = XSYMBOL (symbol);
 +  valcontents = SYMBOL_VALUE (symbol);
  
 - start:
 -  switch (sym->redirect)
 +  /* Handle variables like case-fold-search that have special slots
 +     in the buffer.  Make them work apparently like Lisp_Buffer_Local_Value
 +     variables.  */
 +  if (BUFFER_OBJFWDP (valcontents))
      {
 -    case SYMBOL_VARALIAS: sym = indirect_variable (sym); goto start;
 -    case SYMBOL_PLAINVAL: return Fset (symbol, value);
 -    case SYMBOL_LOCALIZED:
 -      {
 -      struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym);
 +      int offset = XBUFFER_OBJFWD (valcontents)->offset;
 +      int idx = PER_BUFFER_IDX (offset);
  
 -      /* Store new value into the DEFAULT-VALUE slot.  */
 -      XSETCDR (blv->defcell, value);
 +      PER_BUFFER_DEFAULT (offset) = value;
  
 -      /* If the default binding is now loaded, set the REALVALUE slot too.  */
 -      if (blv->fwd && EQ (blv->defcell, blv->valcell))
 -        store_symval_forwarding (blv->fwd, value, NULL);
 -      return value;
 -      }
 -    case SYMBOL_FORWARDED:
 -      {
 -      union Lisp_Fwd *valcontents = SYMBOL_FWD (sym);
 +      /* If this variable is not always local in all buffers,
 +       set it in the buffers that don't nominally have a local value.  */
 +      if (idx > 0)
 +      {
 +        struct buffer *b;
  
 -      /* Handle variables like case-fold-search that have special slots
 -         in the buffer.
 -         Make them work apparently like Lisp_Buffer_Local_Value variables.  */
 -      if (BUFFER_OBJFWDP (valcontents))
 -        {
 -          int offset = XBUFFER_OBJFWD (valcontents)->offset;
 -          int idx = PER_BUFFER_IDX (offset);
 +        for (b = all_buffers; b; b = b->next)
 +          if (!PER_BUFFER_VALUE_P (b, idx))
 +            PER_BUFFER_VALUE (b, offset) = value;
 +      }
 +      return value;
 +    }
 +
 +  if (!BUFFER_LOCAL_VALUEP (valcontents))
 +    return Fset (symbol, value);
  
 -          PER_BUFFER_DEFAULT (offset) = value;
 +  /* Store new value into the DEFAULT-VALUE slot.  */
 +  XSETCDR (XBUFFER_LOCAL_VALUE (valcontents)->cdr, value);
  
 -          /* If this variable is not always local in all buffers,
 -             set it in the buffers that don't nominally have a local value.  
*/
 -          if (idx > 0)
 -            {
 -              struct buffer *b;
++<<<<<<< HEAD
 +  /* If the default binding is now loaded, set the REALVALUE slot too.  */
 +  current_alist_element
 +    = XCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr);
 +  alist_element_buffer = Fcar (current_alist_element);
 +  if (EQ (alist_element_buffer, current_alist_element))
 +    store_symval_forwarding (symbol,
 +                           XBUFFER_LOCAL_VALUE (valcontents)->realvalue,
 +                           value, NULL);
  
 +  return value;
++=======
+               for (b = all_buffers; b; b = b->header.next.buffer)
+                 if (!PER_BUFFER_VALUE_P (b, idx))
+                   PER_BUFFER_VALUE (b, offset) = value;
+             }
+           return value;
+         }
+       else
+         return Fset (symbol, value);
+       }
+     default: abort ();
+     }
++>>>>>>> 1c05634... lisp.h: Fix a problem with aliasing and vector headers.
  }
  
  DEFUN ("setq-default", Fsetq_default, Ssetq_default, 0, UNEVALLED, 0,
diff --cc src/disptab.h
index 92a4270,76fc586..0000000
--- a/src/disptab.h
+++ b/src/disptab.h
@@@ -103,6 -95,3 +103,9 @@@ extern Lisp_Object Vglyph_table
  
  #define SET_GLYPH_FROM_CHAR(glyph, c) \
    SET_GLYPH (glyph, c, DEFAULT_FACE_ID)
++<<<<<<< HEAD
 +
 +/* arch-tag: d7f792d2-f59c-4904-a91e-91522e3ab349
 +   (do not change this comment) */
++=======
++>>>>>>> 1c05634... lisp.h: Fix a problem with aliasing and vector headers.
diff --cc src/fns.c
index 064c4d2,a128b92..0000000
--- a/src/fns.c
+++ b/src/fns.c
@@@ -4022,9 -3681,9 +4022,15 @@@ copy_hash_table (h1
    struct Lisp_Vector *next;
  
    h2 = allocate_hash_table ();
++<<<<<<< HEAD
 +  next = h2->vec_next;
 +  bcopy (h1, h2, sizeof *h2);
 +  h2->vec_next = next;
++=======
+   next = h2->header.next.vector;
+   memcpy (h2, h1, sizeof *h2);
+   h2->header.next.vector = next;
++>>>>>>> 1c05634... lisp.h: Fix a problem with aliasing and vector headers.
    h2->key_and_value = Fcopy_sequence (h1->key_and_value);
    h2->hash = Fcopy_sequence (h1->hash);
    h2->next = Fcopy_sequence (h1->next);
diff --cc src/indent.c
index e92e6b2,a5ac2ab..0000000
--- a/src/indent.c
+++ b/src/indent.c
@@@ -152,10 -140,10 +152,17 @@@ recompute_width_table (buf, disptab
    int i;
    struct Lisp_Vector *widthtab;
  
++<<<<<<< HEAD
 +  if (!VECTORP (buf->width_table))
 +    buf->width_table = Fmake_vector (make_number (256), make_number (0));
 +  widthtab = XVECTOR (buf->width_table);
 +  if (widthtab->size != 256)
++=======
+   if (!VECTORP (BVAR (buf, width_table)))
+     BVAR (buf, width_table) = Fmake_vector (make_number (256), make_number 
(0));
+   widthtab = XVECTOR (BVAR (buf, width_table));
+   if (widthtab->header.size != 256)
++>>>>>>> 1c05634... lisp.h: Fix a problem with aliasing and vector headers.
      abort ();
  
    for (i = 0; i < 256; i++)
@@@ -300,12 -283,10 +307,17 @@@ skip_invisible (pos, next_boundary_p, t
        width = bytes * 4;                                              \
      else                                                              \
        {                                                                       
\
++<<<<<<< HEAD
 +      if (dp != 0 && VECTORP (DISP_CHAR_VECTOR (dp, c)))              \
 +        width = XVECTOR (DISP_CHAR_VECTOR (dp, c))->size;             \
++=======
+       if (dp != 0 && VECTORP (DISP_CHAR_VECTOR (dp, ch)))             \
+         width = XVECTOR_SIZE (DISP_CHAR_VECTOR (dp, ch));             \
++>>>>>>> 1c05634... lisp.h: Fix a problem with aliasing and vector headers.
        else                                                            \
 -        width = CHAR_WIDTH (ch);                                      \
 +        width = CHAR_WIDTH (c);                                       \
 +      if (width > 1)                                                  \
 +        wide_column = width;                                          \
        }                                                                       
\
    } while (0)
  
@@@ -1150,16 -1118,16 +1162,16 @@@ compute_motion (from, fromvpos, fromhpo
    register EMACS_INT pos;
    EMACS_INT pos_byte;
    register int c = 0;
 -  register EMACS_INT tab_width = XFASTINT (BVAR (current_buffer, tab_width));
 -  register int ctl_arrow = !NILP (BVAR (current_buffer, ctl_arrow));
 +  register EMACS_INT tab_width = XFASTINT (current_buffer->tab_width);
 +  register int ctl_arrow = !NILP (current_buffer->ctl_arrow);
    register struct Lisp_Char_Table *dp = window_display_table (win);
 -  EMACS_INT selective
 -    = (INTEGERP (BVAR (current_buffer, selective_display))
 -       ? XINT (BVAR (current_buffer, selective_display))
 -       : !NILP (BVAR (current_buffer, selective_display)) ? -1 : 0);
 +  int selective
 +    = (INTEGERP (current_buffer->selective_display)
 +       ? XINT (current_buffer->selective_display)
 +       : !NILP (current_buffer->selective_display) ? -1 : 0);
    int selective_rlen
      = (selective && dp && VECTORP (DISP_INVIS_VECTOR (dp))
-        ? XVECTOR (DISP_INVIS_VECTOR (dp))->size : 0);
+        ? XVECTOR_SIZE (DISP_INVIS_VECTOR (dp)) : 0);
    /* The next location where the `invisible' property changes, or an
       overlay starts or ends.  */
    EMACS_INT next_boundary = from;
diff --cc src/keyboard.c
index 6a63caa,8c4f7bd..0000000
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@@ -130,14 -130,11 +130,14 @@@ int this_command_key_count_reset
  
  /* This vector is used as a buffer to record the events that were actually 
read
     by read_key_sequence.  */
 -static Lisp_Object raw_keybuf;
 -static int raw_keybuf_count;
 +Lisp_Object raw_keybuf;
 +int raw_keybuf_count;
 +
 +/* Non-nil if the present key sequence was obtained by shift translation.  */
 +Lisp_Object Vthis_command_keys_shift_translated;
  
  #define GROW_RAW_KEYBUF                                                       
\
-  if (raw_keybuf_count == XVECTOR (raw_keybuf)->size)                  \
+  if (raw_keybuf_count == XVECTOR_SIZE (raw_keybuf))                   \
     raw_keybuf = larger_vector (raw_keybuf, raw_keybuf_count * 2, Qnil)  \
  
  /* Number of elements of this_command_keys
@@@ -3200,11 -2895,11 +3200,19 @@@ read_char (commandflag, nmaps, maps, pr
        if (XINT (c) == -1)
        goto exit;
  
++<<<<<<< HEAD
 +      if ((STRINGP (current_kboard->Vkeyboard_translate_table)
 +         && SCHARS (current_kboard->Vkeyboard_translate_table) > (unsigned) 
XFASTINT (c))
 +        || (VECTORP (current_kboard->Vkeyboard_translate_table)
 +            && XVECTOR (current_kboard->Vkeyboard_translate_table)->size > 
(unsigned) XFASTINT (c))
 +        || (CHAR_TABLE_P (current_kboard->Vkeyboard_translate_table)
++=======
+       if ((STRINGP (KVAR (current_kboard, Vkeyboard_translate_table))
+          && SCHARS (KVAR (current_kboard, Vkeyboard_translate_table)) > 
(unsigned) XFASTINT (c))
+         || (VECTORP (KVAR (current_kboard, Vkeyboard_translate_table))
+             && XVECTOR_SIZE (KVAR (current_kboard, 
Vkeyboard_translate_table)) > (unsigned) XFASTINT (c))
+         || (CHAR_TABLE_P (KVAR (current_kboard, Vkeyboard_translate_table))
++>>>>>>> 1c05634... lisp.h: Fix a problem with aliasing and vector headers.
              && CHARACTERP (c)))
        {
          Lisp_Object d;
@@@ -4640,13 -4285,15 +4648,13 @@@ timer_check_2 (
        Lisp_Object *vector;
        Lisp_Object timer = Qnil, idle_timer = Qnil;
        EMACS_TIME timer_time, idle_timer_time;
 -      EMACS_TIME difference;
 -      EMACS_TIME timer_difference IF_LINT (= {0});
 -      EMACS_TIME idle_timer_difference IF_LINT (= {0});
 +      EMACS_TIME difference, timer_difference, idle_timer_difference;
  
        /* Skip past invalid timers and timers already handled.  */
 -      if (CONSP (timers))
 +      if (!NILP (timers))
        {
          timer = XCAR (timers);
-         if (!VECTORP (timer) || XVECTOR (timer)->size != 8)
+         if (!VECTORP (timer) || XVECTOR_SIZE (timer) != 8)
            {
              timers = XCDR (timers);
              continue;
@@@ -4661,10 -4308,10 +4669,10 @@@
              continue;
            }
        }
 -      if (CONSP (idle_timers))
 +      if (!NILP (idle_timers))
        {
          timer = XCAR (idle_timers);
-         if (!VECTORP (timer) || XVECTOR (timer)->size != 8)
+         if (!VECTORP (timer) || XVECTOR_SIZE (timer) != 8)
            {
              idle_timers = XCDR (idle_timers);
              continue;
@@@ -7864,15 -7477,18 +7872,30 @@@ menu_bar_items (old
      }
  
    /* Add nil, nil, nil, nil at the end.  */
++<<<<<<< HEAD
 +  i = menu_bar_items_index;
 +  if (i + 4 > XVECTOR (menu_bar_items_vector)->size)
 +    menu_bar_items_vector = larger_vector (menu_bar_items_vector, 2 * i, 
Qnil);
 +  /* Add this item.  */
 +  XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil;
 +  XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil;
 +  XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil;
 +  XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil;
 +  menu_bar_items_index = i;
++=======
+   {
+     int i = menu_bar_items_index;
+     if (i + 4 > XVECTOR_SIZE (menu_bar_items_vector))
+       menu_bar_items_vector =
+       larger_vector (menu_bar_items_vector, 2 * i, Qnil);
+     /* Add this item.  */
+     XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil;
+     XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil;
+     XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil;
+     XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil;
+     menu_bar_items_index = i;
+   }
++>>>>>>> 1c05634... lisp.h: Fix a problem with aliasing and vector headers.
  
    Vinhibit_quit = oquit;
    return menu_bar_items_vector;
@@@ -8571,9 -8217,9 +8594,9 @@@ parse_tool_bar_item (key, item
              PROP (TOOL_BAR_ITEM_TYPE) = type;
            }
        }
 -      else if (EQ (ikey, QCimage)
 +      else if (EQ (key, QCimage)
               && (CONSP (value)
-                  || (VECTORP (value) && XVECTOR (value)->size == 4)))
+                  || (VECTORP (value) && XVECTOR_SIZE (value) == 4)))
        /* Value is either a single image specification or a vector
           of 4 such specifications for the different button states.  */
        PROP (TOOL_BAR_ITEM_IMAGES) = value;
@@@ -10244,8 -9926,8 +10267,13 @@@ read_key_sequence (keybuf, bufsize, pro
              /* Treat uppercase keys as shifted.  */
              || (INTEGERP (key)
                  && (KEY_TO_CHAR (key)
++<<<<<<< HEAD
 +                    < XCHAR_TABLE (current_buffer->downcase_table)->size)
 +                && UPPERCASEP (KEY_TO_CHAR (key))))
++=======
+                     < XCHAR_TABLE (BVAR (current_buffer, 
downcase_table))->header.size)
+                 && uppercasep (KEY_TO_CHAR (key))))
++>>>>>>> 1c05634... lisp.h: Fix a problem with aliasing and vector headers.
            {
              Lisp_Object new_key
                = (modifiers & shift_modifier
diff --cc src/keymap.c
index b3c1400,110447b..0000000
--- a/src/keymap.c
+++ b/src/keymap.c
@@@ -3253,13 -3121,13 +3253,18 @@@ key             binding\n
        /* Delete from MAPS each element that is for the menu bar.  */
        for (list = maps; CONSP (list); list = XCDR (list))
        {
 -        Lisp_Object elt, elt_prefix, tem;
 +        Lisp_Object elt, prefix, tem;
  
          elt = XCAR (list);
++<<<<<<< HEAD
 +        prefix = Fcar (elt);
 +        if (XVECTOR (prefix)->size >= 1)
++=======
+         elt_prefix = Fcar (elt);
+         if (XVECTOR_SIZE (elt_prefix) >= 1)
++>>>>>>> 1c05634... lisp.h: Fix a problem with aliasing and vector headers.
            {
 -            tem = Faref (elt_prefix, make_number (0));
 +            tem = Faref (prefix, make_number (0));
              if (EQ (tem, Qmenu_bar))
                maps = Fdelq (elt, maps);
            }
@@@ -3299,8 -3167,8 +3304,13 @@@
  
          /* If the sequence by which we reach this keymap is zero-length,
             then the shadow map for this keymap is just SHADOW.  */
++<<<<<<< HEAD
 +        if ((STRINGP (prefix) && SCHARS (prefix) == 0)
 +            || (VECTORP (prefix) && XVECTOR (prefix)->size == 0))
++=======
+         if ((STRINGP (elt_prefix) && SCHARS (elt_prefix) == 0)
+             || (VECTORP (elt_prefix) && XVECTOR_SIZE (elt_prefix) == 0))
++>>>>>>> 1c05634... lisp.h: Fix a problem with aliasing and vector headers.
            ;
          /* If the sequence by which we reach this keymap actually has
             some elements, then the sequence's definition in SHADOW is
diff --cc src/lisp.h
index 34330b0,e717e7c..0000000
--- a/src/lisp.h
+++ b/src/lisp.h
@@@ -774,17 -790,21 +786,32 @@@ struct Lisp_Strin
      unsigned char *data;
    };
  
++<<<<<<< HEAD
 +#ifdef offsetof
 +#define OFFSETOF(type,field) offsetof(type,field)
 +#else
 +#define OFFSETOF(type,field) \
 +  ((int)((char*)&((type*)0)->field - (char*)0))
 +#endif
 +
 +struct Lisp_Vector
++=======
+ /* Header of vector-like objects.  This type documents the constraints on
+    layout of vectors and pseudovectors, and helps optimizing compilers not get
+    fooled by Emacs's type punning.  */
+ struct vector_header
++>>>>>>> 1c05634... lisp.h: Fix a problem with aliasing and vector headers.
    {
      EMACS_UINT size;
-     struct Lisp_Vector *next;
+     union {
+       struct buffer *buffer;
+       struct Lisp_Vector *vector;
+     } next;
+   };
+ 
+ struct Lisp_Vector
+   {
+     struct vector_header header;
      Lisp_Object contents[1];
    };
  
@@@ -1551,18 -1639,16 +1574,18 @@@ typedef struct 
  #define CONSP(x) (XTYPE ((x)) == Lisp_Cons)
  
  #define FLOATP(x) (XTYPE ((x)) == Lisp_Float)
- #define VECTORP(x)    (VECTORLIKEP (x) && !(XVECTOR (x)->size & 
PSEUDOVECTOR_FLAG))
+ #define VECTORP(x)    (VECTORLIKEP (x) && !(XVECTOR_SIZE (x) & 
PSEUDOVECTOR_FLAG))
  #define OVERLAYP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Overlay)
  #define MARKERP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Marker)
 +#define INTFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Intfwd)
 +#define BOOLFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Boolfwd)
 +#define OBJFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Objfwd)
 +#define BUFFER_OBJFWDP(x) (MISCP (x) && XMISCTYPE (x) == 
Lisp_Misc_Buffer_Objfwd)
 +#define BUFFER_LOCAL_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == 
Lisp_Misc_Buffer_Local_Value)
 +#define SOME_BUFFER_LOCAL_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == 
Lisp_Misc_Some_Buffer_Local_Value)
 +#define KBOARD_OBJFWDP(x) (MISCP (x) && XMISCTYPE (x) == 
Lisp_Misc_Kboard_Objfwd)
  #define SAVE_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Save_Value)
  
 -#define INTFWDP(x) (XFWDTYPE (x) == Lisp_Fwd_Int)
 -#define BOOLFWDP(x) (XFWDTYPE (x) == Lisp_Fwd_Bool)
 -#define OBJFWDP(x) (XFWDTYPE (x) == Lisp_Fwd_Obj)
 -#define BUFFER_OBJFWDP(x) (XFWDTYPE (x) == Lisp_Fwd_Buffer_Obj)
 -#define KBOARD_OBJFWDP(x) (XFWDTYPE (x) == Lisp_Fwd_Kboard_Obj)
  
  /* True if object X is a pseudovector whose code is CODE.  */
  #define PSEUDOVECTORP(x, code)                                        \
diff --cc src/minibuf.c
index 90df137,b73b241..0000000
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@@ -1326,8 -1227,8 +1326,13 @@@ is used to further constrain the set o
    if (type == obarray_table)
      {
        collection = check_obarray (collection);
++<<<<<<< HEAD
 +      obsize = XVECTOR (collection)->size;
 +      bucket = XVECTOR (collection)->contents[index];
++=======
+       obsize = XVECTOR_SIZE (collection);
+       bucket = XVECTOR (collection)->contents[idx];
++>>>>>>> 1c05634... lisp.h: Fix a problem with aliasing and vector headers.
      }
  
    while (1)
@@@ -1590,8 -1490,8 +1595,13 @@@ with a space are ignored unless STRING 
    if (type == 2)
      {
        collection = check_obarray (collection);
++<<<<<<< HEAD
 +      obsize = XVECTOR (collection)->size;
 +      bucket = XVECTOR (collection)->contents[index];
++=======
+       obsize = XVECTOR_SIZE (collection);
+       bucket = XVECTOR (collection)->contents[idx];
++>>>>>>> 1c05634... lisp.h: Fix a problem with aliasing and vector headers.
      }
  
    while (1)
diff --cc src/print.c
index 682212d,8f55904..0000000
--- a/src/print.c
+++ b/src/print.c
@@@ -2046,24 -1781,24 +2046,34 @@@ print_object (obj, printcharfun, escape
            {
              PRINTCHAR (' ');
              PRINTCHAR ('\'');
 -            strout (SDATA (SYMBOL_NAME (h->test)), -1, -1, printcharfun);
 +            strout (SDATA (SYMBOL_NAME (h->test)), -1, -1, printcharfun, 0);
              PRINTCHAR (' ');
 -            strout (SDATA (SYMBOL_NAME (h->weak)), -1, -1, printcharfun);
 +            strout (SDATA (SYMBOL_NAME (h->weak)), -1, -1, printcharfun, 0);
              PRINTCHAR (' ');
              sprintf (buf, "%ld/%ld", (long) h->count,
++<<<<<<< HEAD
 +                     (long) XVECTOR (h->next)->size);
 +            strout (buf, -1, -1, printcharfun, 0);
++=======
+                      (long) XVECTOR_SIZE (h->next));
+             strout (buf, -1, -1, printcharfun);
++>>>>>>> 1c05634... lisp.h: Fix a problem with aliasing and vector headers.
            }
          sprintf (buf, " 0x%lx", (unsigned long) h);
 -        strout (buf, -1, -1, printcharfun);
 +        strout (buf, -1, -1, printcharfun, 0);
          PRINTCHAR ('>');
  #endif
          /* Implement a readable output, e.g.:
            #s(hash-table size 2 test equal data (k1 v1 k2 v2)) */
          /* Always print the size. */
          sprintf (buf, "#s(hash-table size %ld",
++<<<<<<< HEAD
 +                 (long) XVECTOR (h->next)->size);
 +        strout (buf, -1, -1, printcharfun, 0);
++=======
+                  (long) XVECTOR_SIZE (h->next));
+         strout (buf, -1, -1, printcharfun);
++>>>>>>> 1c05634... lisp.h: Fix a problem with aliasing and vector headers.
  
          if (!NILP (h->test))
            {
@@@ -2354,12 -2025,12 +2364,16 @@@
        if (MISCP (obj))
          sprintf (buf, "(MISC 0x%04x)", (int) XMISCTYPE (obj));
        else if (VECTORLIKEP (obj))
++<<<<<<< HEAD
 +        sprintf (buf, "(PVEC 0x%08x)", (int) XVECTOR (obj)->size);
++=======
+         sprintf (buf, "(PVEC 0x%08lx)", (unsigned long) XVECTOR_SIZE (obj));
++>>>>>>> 1c05634... lisp.h: Fix a problem with aliasing and vector headers.
        else
          sprintf (buf, "(0x%02x)", (int) XTYPE (obj));
 -      strout (buf, -1, -1, printcharfun);
 +      strout (buf, -1, -1, printcharfun, 0);
        strout (" Save your buffers immediately and please report this bug>",
 -              -1, -1, printcharfun);
 +              -1, -1, printcharfun, 0);
        }
      }
  
diff --cc src/w32font.c
index 0f01ceb,a9fa525..0000000
--- a/src/w32font.c
+++ b/src/w32font.c
@@@ -2654,6 -2581,3 +2654,9 @@@ versions of Windows) characters.  */)
    w32font_driver.type = Qgdi;
    register_font_driver (&w32font_driver, NULL);
  }
++<<<<<<< HEAD
 +
 +/* arch-tag: 65b8a3cd-46aa-4c0d-a1f3-99e75b9c07ee
 +   (do not change this comment) */
++=======
++>>>>>>> 1c05634... lisp.h: Fix a problem with aliasing and vector headers.
diff --cc src/xmenu.c
index c2e70e1,aac7fd4..0000000
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@@ -1056,13 -1011,13 +1056,21 @@@ set_frame_menubar (f, first_time, deep_
  
        menu_items = f->menu_bar_vector;
        menu_items_allocated = VECTORP (menu_items) ? ASIZE (menu_items) : 0;
++<<<<<<< HEAD
 +      submenu_start = (int *) alloca (XVECTOR (items)->size * sizeof (int *));
 +      submenu_end = (int *) alloca (XVECTOR (items)->size * sizeof (int *));
 +      submenu_n_panes = (int *) alloca (XVECTOR (items)->size * sizeof (int));
 +      submenu_top_level_items
 +      = (int *) alloca (XVECTOR (items)->size * sizeof (int *));
++=======
+       subitems = XVECTOR_SIZE (items) / 4;
+       submenu_start = (int *) alloca (subitems * sizeof (int *));
+       submenu_end = (int *) alloca (subitems * sizeof (int *));
+       submenu_n_panes = (int *) alloca (subitems * sizeof (int));
+       submenu_top_level_items = (int *) alloca (subitems * sizeof (int *));
++>>>>>>> 1c05634... lisp.h: Fix a problem with aliasing and vector headers.
        init_menu_items ();
 -      for (i = 0; i < subitems; i++)
 +      for (i = 0; i < XVECTOR (items)->size; i += 4)
        {
          Lisp_Object key, string, maps;
  






reply via email to

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