From: Philipp Stephani Date: Sat, 1 Aug 2020 19:01:24 +0000 (+0200) Subject: Improve offset calculation in wide int builds X-Git-Tag: emacs-28.0.90~6873 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fce47c93252fe0be14e8c169f6bab8b0fd512cab;p=emacs.git Improve offset calculation in wide int builds * src/alloc.c (mark_maybe_object): Make sure that OFFSET isn’t widened during subtraction. --- diff --git a/src/alloc.c b/src/alloc.c index f203061161b..e556fc86a3b 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -4641,8 +4641,10 @@ mark_maybe_object (Lisp_Object obj) break; } - void *po = (char *) ((intptr_t) (char *) XLP (obj) - + (offset - LISP_WORD_TAG (type_tag))); + bool overflow + = INT_SUBTRACT_WRAPV (offset, LISP_WORD_TAG (type_tag), &offset); + eassert (!overflow); + void *po = (char *) ((intptr_t) (char *) XLP (obj) + offset); /* If the pointer is in the dump image and the dump has a record of the object starting at the place where the pointer points, we