[committed] use get_size_range instead of get_range to obtain range of valid sizes

Martin Sebor msebor@gmail.com
Sun Aug 30 21:20:15 GMT 2020


The get_size_range() function is more appropriate to call than 
get_range() in contexts where the range of object sizes is needed
because (as also mentioned in the patch for PR 92942 I submitted
last Friday) it has the necessary logic to constrain the range to
just the values that are valid for object sizes.

The attached change makes use of get_size_range() to get consistent
results regardless of the data model (ILP32 vs LP64) and avoid
failures on ILP32 in a couple of tests I recently committed, as
pointed out in:

https://gcc.gnu.org/pipermail/gcc-patches/2020-August/552956.html
https://gcc.gnu.org/pipermail/gcc-patches/2020-August/552961.html

I have committed the change in r11-2941.

Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc-wstringop-overread-2.diff
Type: text/x-patch
Size: 5545 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20200830/a5e05b63/attachment.bin>


More information about the Gcc-patches mailing list