]> git.eshelyaron.com Git - emacs.git/commit
Don't use pointer arithmetic for pointer tagging (bug#65491)
authorMattias Engdegård <mattiase@acm.org>
Mon, 18 Sep 2023 17:16:05 +0000 (19:16 +0200)
committerMattias Engdegård <mattiase@acm.org>
Tue, 19 Sep 2023 13:21:03 +0000 (15:21 +0200)
commit321f2e1e4d4b2f209b072dc891cc89cbab19f032
tree8d5747df71c6936ed27e75b787460e10f6c415cd
parent7be5c8f47c9df01a5accdbf954d952b9bbe5b5f0
Don't use pointer arithmetic for pointer tagging (bug#65491)

This makes for safer code when tagging null pointers in particular,
since pointer arithmetic on NULL is undefined and therefore can be
assumed, by the compiler, not to occur.

* src/lisp.h (untagged_ptr): Remove.
(TAG_PTR): Cast to uintptr_t instead of untagged_ptr.
src/lisp.h