diff options
author | Philipp Stephani <phst@google.com> | 2020-08-01 21:01:24 +0200 |
---|---|---|
committer | Philipp Stephani <phst@google.com> | 2020-08-01 21:02:33 +0200 |
commit | fce47c93252fe0be14e8c169f6bab8b0fd512cab (patch) | |
tree | 1d53951ffc72f91f2be6703f39bd623e4b21cc8f /src/alloc.c | |
parent | 1d70fbe4c83d6439716a054f6c074202c534a425 (diff) | |
download | emacs-fce47c93252fe0be14e8c169f6bab8b0fd512cab.tar.gz emacs-fce47c93252fe0be14e8c169f6bab8b0fd512cab.tar.bz2 emacs-fce47c93252fe0be14e8c169f6bab8b0fd512cab.zip |
Improve offset calculation in wide int builds
* src/alloc.c (mark_maybe_object): Make sure that OFFSET isn’t widened
during subtraction.
Diffstat (limited to 'src/alloc.c')
-rw-r--r-- | src/alloc.c | 6 |
1 files changed, 4 insertions, 2 deletions
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 |