diff options
author | Alan Modra <amodra@gmail.com> | 2021-05-12 12:51:52 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2021-05-12 21:17:35 +0930 |
commit | 6d1ad6f7834d62bedec138aaf3ac872c60702ecd (patch) | |
tree | 5cc97c318071d405f410fd3c295269811a3a1f1b /gold/dynobj.h | |
parent | af2ddf69ab85add3155cf55f65e6e9f3c9bcb29a (diff) | |
download | gdb-6d1ad6f7834d62bedec138aaf3ac872c60702ecd.zip gdb-6d1ad6f7834d62bedec138aaf3ac872c60702ecd.tar.gz gdb-6d1ad6f7834d62bedec138aaf3ac872c60702ecd.tar.bz2 |
SAFE_BYTE_GET
This rearranges SAFE_BYTE_GET* macros, eliminating some duplication,
and making sure that the _INC variants never increment their PTR arg
past END. I've added an assertion that should show us places where we
use them improperly with user derived PTR args, which I'm sure the
fuzzers will find for us.
* dwarf.c (SAFE_BYTE_GET_INTERNAL): Define.
(SAFE_BYTE_GET, SAFE_BYTE_GET_AND_INC): Define using the above.
(SAFE_SIGNED_BYTE_GET, SAFE_SIGNED_BYTE_GET_AND_INC): Likewise.
(display_discr_list): Use SAFE_BYTE_GET_AND_INC rather than
SAFE_BYTE_GET followed by increment.
(process_debug_info): Likewise, and test bytes remaining before
incrementing section_begin rather than using pointer comparison.
(display_debug_names): Pass lvalue as SAFE_BYTE_GET PTR.
(process_cu_tu_index): Likewise for SAFE_BYTE_GET_AND_INC.
Diffstat (limited to 'gold/dynobj.h')
0 files changed, 0 insertions, 0 deletions