diff options
| author | Vibhav Pant | 2023-01-04 17:15:00 +0530 |
|---|---|---|
| committer | Vibhav Pant | 2023-01-04 17:15:00 +0530 |
| commit | 0246e122df8a3107df57d17226be198656f89071 (patch) | |
| tree | c63b5997ee509f1a42ad3a1ab8cde1da86b2d257 /lib/malloc/dynarray_resize.c | |
| parent | 4a0854c9e327453835c35453b8708b5f4129270f (diff) | |
| download | emacs-0246e122df8a3107df57d17226be198656f89071.tar.gz emacs-0246e122df8a3107df57d17226be198656f89071.zip | |
Avoid accessing Lisp_Vector's size field directly.
When Emacs is built with support for statically emitted Lisp literals
during native compilation, the generated objects (in this case,
vectors) have their mark bits set to 1. This may cause code that
accesses header.size directly (i.e, not through ASIZE) to get invalid
values as the vector's length, causing further problems down the
line.
* src/lisp.h (VECTOR_ASIZE): New function.
* src/ccl.c (setup_ccl_program): Use VECTOR_ASIZE to get vp's length.
* src/indent.c (disptab_matches_widthtab, recompute_width_table): Use
VECTOR_ASIZE to get widthtab's length.
* src/process.c (Fformat_network_address): Use vector macros in lisp.h
to access address's fields and length.
(conv_addrinfo_to_lisp, get_lisp_to_sockaddr_size): Use ASIZE to get
address's length.
* src/window.c (Fset_window_configuration): Use VECTOR_ASIZE to get
saved_window's length.
(compare_window_configurations): Use VECTOR_ASIZE to get sws1's
length.
* src/xdisp.c (setup_for_ellipsis, get_next_display_element,
on_hot_spot_p): Use VECTOR_ASIZE to get v's length.
Diffstat (limited to 'lib/malloc/dynarray_resize.c')
0 files changed, 0 insertions, 0 deletions