From 5045e68e7015710cc94ee6cbbd8bc81bad67d625 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 10 Jul 2007 18:00:44 +0000 Subject: [PATCH] (mark_maybe_pointer): Enforce mult-of-8 alignment when using USE_LSB_TAG. Suggested by Dmitry Antipov . --- src/ChangeLog | 3 +++ src/alloc.c | 11 ++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index e417ff9ee86..ed9053e851a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2007-07-10 Stefan Monnier + * alloc.c (mark_maybe_pointer): Enforce mult-of-8 alignment when using + USE_LSB_TAG. Suggested by Dmitry Antipov . + * fns.c (map_char_table): Use an array of int for `indices' rather than an array of Lisp_Objects (which are only ever integers anyway). (Fmap_char_table): Update caller. diff --git a/src/alloc.c b/src/alloc.c index 7668309e59c..f3140da1ddc 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -4263,9 +4263,14 @@ mark_maybe_pointer (p) { struct mem_node *m; - /* Quickly rule out some values which can't point to Lisp data. We - assume that Lisp data is aligned on even addresses. */ - if ((EMACS_INT) p & 1) + /* Quickly rule out some values which can't point to Lisp data. */ + if ((EMACS_INT) p % +#ifdef USE_LSB_TAG + 8 /* USE_LSB_TAG needs Lisp data to be aligned on multiples of 8. */ +#else + 2 /* We assume that Lisp data is aligned on even addresses. */ +#endif + ) return; m = mem_find (p); -- 2.39.2