emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 2e9d1f4 2/2: * src/alloc.c (mark_maybe_object): Avoid signed inte


From: Philipp Stephani
Subject: master 2e9d1f4 2/2: * src/alloc.c (mark_maybe_object): Avoid signed integer overflow
Date: Sun, 2 Aug 2020 10:25:59 -0400 (EDT)

branch: master
commit 2e9d1f4d44036e7c0605cfeac091368e013e3ed9
Author: Philipp Stephani <phst@google.com>
Commit: Philipp Stephani <phst@google.com>

    * src/alloc.c (mark_maybe_object): Avoid signed integer overflow
---
 src/alloc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/alloc.c b/src/alloc.c
index da11426..5220ef8 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -4652,7 +4652,8 @@ mark_maybe_object (Lisp_Object obj)
 #else
   (void) overflow;
 #endif
-  void *po = (char *) ((intptr_t) (char *) XLP (obj) + offset);
+  INT_ADD_WRAPV (offset, (intptr_t) (char *) XLP (obj), &offset);
+  void *po = (char *) 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]