diff options
author | Martin Sebor <msebor@redhat.com> | 2017-05-04 23:50:21 +0000 |
---|---|---|
committer | Martin Sebor <msebor@gcc.gnu.org> | 2017-05-04 17:50:21 -0600 |
commit | d9c5a8b98a21ab0091bbe0f3dab93dd59e6c58fb (patch) | |
tree | 84e9df2d0bf355d3dd1816f7a7833c5fc6204ff1 /gcc/tree.c | |
parent | 0f3587ec0e7af6140ceb75947144baf42676617b (diff) | |
download | gcc-d9c5a8b98a21ab0091bbe0f3dab93dd59e6c58fb.zip gcc-d9c5a8b98a21ab0091bbe0f3dab93dd59e6c58fb.tar.gz gcc-d9c5a8b98a21ab0091bbe0f3dab93dd59e6c58fb.tar.bz2 |
PR libstdc++/54924 - Warn for std::string constructor with wrong size
PR libstdc++/54924 - Warn for std::string constructor with wrong size
PR middle-end/79234 - warn on past the end reads by library functions
gcc/ChangeLog:
PR middle-end/79234
* builtins.c (check_sizes): Adjust to handle reading past the end.
Avoid printing excessive upper bound of ranges. Use %E to print
tree nodes instead of converting them to %wu.
(expand_builtin_memchr): New function.
(compute_dest_size): Rename...
(compute_objsize): ...to this.
(expand_builtin_memcpy): Adjust.
(expand_builtin_mempcpy): Adjust.
(expand_builtin_strcat): Adjust.
(expand_builtin_strcpy): Adjust.
(check_strncat_sizes): Adjust.
(expand_builtin_strncat): Adjust.
(expand_builtin_strncpy): Adjust and simplify.
(expand_builtin_memset): Adjust.
(expand_builtin_bzero): Adjust.
(expand_builtin_memcmp): Adjust.
(expand_builtin): Handle memcmp.
(maybe_emit_chk_warning): Check strncat just once.
gcc/testsuite/ChangeLog:
PR middle-end/79234
* gcc.dg/builtin-stringop-chk-8.c: New test.
* gcc.dg/builtin-stringop-chk-1.c: Adjust.
* gcc.dg/builtin-stringop-chk-4.c: Same.
* gcc.dg/builtin-strncat-chk-1.c: Same.
* g++.dg/ext/strncpy-chk1.C: Same.
* g++.dg/torture/Wsizeof-pointer-memaccess1.C: Same.
* gcc.dg/out-of-bounds-1.c: Same.
* gcc.dg/pr78138.c: Same.
* gcc.dg/torture/Wsizeof-pointer-memaccess1.c: Same.
* gfortran.dg/mvbits_7.f90: Same.
From-SVN: r247622
Diffstat (limited to 'gcc/tree.c')
0 files changed, 0 insertions, 0 deletions