aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorPaul Eggert2011-07-06 14:56:44 -0700
committerPaul Eggert2011-07-06 14:56:44 -0700
commit437dd18bf116330a43585f85aac12e6a8171b8a2 (patch)
tree940d7fb2657b6aedaa007842c59b703ca9727e5e /src/buffer.c
parent4906cd3d170f550150b28a22c2000dd0b4ff326f (diff)
parent22b4128ef0160a0fab35a5d6dfc0f6a55c8bad93 (diff)
downloademacs-437dd18bf116330a43585f85aac12e6a8171b8a2.tar.gz
emacs-437dd18bf116330a43585f85aac12e6a8171b8a2.zip
Merge: Remove unportable assumption about struct layout (Bug#8884).
* buffer.c (clone_per_buffer_values): Don't assume that sizeof (struct buffer) is a multiple of sizeof (Lisp_Object). This isn't true in general, and it's particularly not true if Emacs is configured with --with-wide-int. * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): New macros, used in the buffer.c change.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 2339416eb36..6c7c2ec0d86 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -471,8 +471,8 @@ clone_per_buffer_values (struct buffer *from, struct buffer *to)
471 471
472 /* buffer-local Lisp variables start at `undo_list', 472 /* buffer-local Lisp variables start at `undo_list',
473 tho only the ones from `name' on are GC'd normally. */ 473 tho only the ones from `name' on are GC'd normally. */
474 for (offset = PER_BUFFER_VAR_OFFSET (undo_list); 474 for (offset = PER_BUFFER_VAR_OFFSET (FIRST_FIELD_PER_BUFFER);
475 offset < sizeof *to; 475 offset <= PER_BUFFER_VAR_OFFSET (LAST_FIELD_PER_BUFFER);
476 offset += sizeof (Lisp_Object)) 476 offset += sizeof (Lisp_Object))
477 { 477 {
478 Lisp_Object obj; 478 Lisp_Object obj;