Skip to content

Commit 0afbde4

Browse files
committed
Pacify gcc -Woverflow more clearly
* src/alloc.c (mark_maybe_pointer): Make it clearer that ANDing with UINTPTR_MAX is intended. Omit a now-unnecessary cast.
1 parent 525d5ca commit 0afbde4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/alloc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4764,7 +4764,9 @@ mark_maybe_pointer (void *p, bool symbol_only)
47644764
from Emacs source code, it can occur in some cases. To fix
47654765
this problem, the pdumper code should grok non-initial
47664766
addresses, as the non-pdumper code does. */
4767-
void *po = (void *) ((uintptr_t) p & (uintptr_t) VALMASK);
4767+
uintptr_t mask = VALMASK & UINTPTR_MAX;
4768+
uintptr_t masked_p = (uintptr_t) p & mask;
4769+
void *po = (void *) masked_p;
47684770
char *cp = p;
47694771
char *cpo = po;
47704772
/* Don't use pdumper_object_p_precise here! It doesn't check the

0 commit comments

Comments
 (0)