aboutsummaryrefslogtreecommitdiff
path: root/gcc/gdbhooks.py
diff options
context:
space:
mode:
authorTim Lange <mail@tim-lange.me>2022-09-10 23:53:48 +0200
committerTim Lange <mail@tim-lange.me>2022-09-11 23:55:20 +0200
commit0ea5e3f4542832b8da016b152695e64a2a386309 (patch)
tree37e285532e7f807019eae14d388dbbedbea5155c /gcc/gdbhooks.py
parent5b3496e2ea632463f4118928a87639454c87a859 (diff)
downloadgcc-0ea5e3f4542832b8da016b152695e64a2a386309.zip
gcc-0ea5e3f4542832b8da016b152695e64a2a386309.tar.gz
gcc-0ea5e3f4542832b8da016b152695e64a2a386309.tar.bz2
analyzer: consider empty ranges and zero byte accesses [PR106845]
This patch adds handling of empty ranges in bit_range and byte_range and adds an assertion to member functions that assume a positive size. Further, the patch fixes an ICE caused by an empty byte_range passed to byte_range::exceeds_p. Regression-tested on Linux x86_64. 2022-09-10 Tim Lange <mail@tim-lange.me> gcc/analyzer/ChangeLog: PR analyzer/106845 * region-model.cc (region_model::check_region_bounds): Bail out if 0 bytes were accessed. * store.cc (byte_range::dump_to_pp): Add special case for empty ranges. (byte_range::exceeds_p): Restrict to non-empty ranges. (byte_range::falls_short_of_p): Restrict to non-empty ranges. * store.h (bit_range::empty_p): New function. (bit_range::get_last_byte_offset): Restrict to non-empty ranges. (byte_range::empty_p): New function. (byte_range::get_last_byte_offset): Restrict to non-empty ranges. gcc/testsuite/ChangeLog: PR analyzer/106845 * gcc.dg/analyzer/out-of-bounds-zero.c: New test. * gcc.dg/analyzer/pr106845.c: New test.
Diffstat (limited to 'gcc/gdbhooks.py')
0 files changed, 0 insertions, 0 deletions