diff options
| author | Philipp Stephani | 2020-08-01 21:01:24 +0200 |
|---|---|---|
| committer | Philipp Stephani | 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.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) | |||
| 4641 | break; | 4641 | break; |
| 4642 | } | 4642 | } |
| 4643 | 4643 | ||
| 4644 | void *po = (char *) ((intptr_t) (char *) XLP (obj) | 4644 | bool overflow |
| 4645 | + (offset - LISP_WORD_TAG (type_tag))); | 4645 | = INT_SUBTRACT_WRAPV (offset, LISP_WORD_TAG (type_tag), &offset); |
| 4646 | eassert (!overflow); | ||
| 4647 | void *po = (char *) ((intptr_t) (char *) XLP (obj) + offset); | ||
| 4646 | 4648 | ||
| 4647 | /* If the pointer is in the dump image and the dump has a record | 4649 | /* If the pointer is in the dump image and the dump has a record |
| 4648 | of the object starting at the place where the pointer points, we | 4650 | of the object starting at the place where the pointer points, we |