aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorMattias EngdegÄrd2023-08-28 11:13:10 +0200
committerMattias EngdegÄrd2023-09-16 16:32:05 +0200
commit056c99a34c143e1b5162366db07a143ac2b10631 (patch)
tree7e18f3c4dd7a8c6c8e797fd8b4f954c6e1e51a2f /java
parentb1881d7dab53b490148b6a19bb6a3fb62f52ad22 (diff)
downloademacs-056c99a34c143e1b5162366db07a143ac2b10631.tar.gz
emacs-056c99a34c143e1b5162366db07a143ac2b10631.zip
Don't use pointer arithmetic for untagging Lisp values
* src/lisp.h (XUNTAG): Instead of casting a Lisp value to char * and subtracting the tag, cast it to a suitable integral type and work on that. This should result in identical or at least equivalent code, except that it avoids potential problems arising from the restrictions on pointer arithmetic in C. In particular, a null pointer can be neither an operand in nor the result of pointer arithmetic. C compilers know this and would, prior to this change, optimise XUNTAG(obj, Lisp_Int0, mytype) != NULL to 1. This means, for example, that make_pointer_integer and XFIXNUMPTR could not be entrusted with null pointers, and next_vector in alloc.c was unsafe to use.
Diffstat (limited to 'java')
0 files changed, 0 insertions, 0 deletions