aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-strlen.c
diff options
context:
space:
mode:
authorMartin Sebor <msebor@redhat.com>2019-03-19 18:35:42 +0000
committerMartin Sebor <msebor@gcc.gnu.org>2019-03-19 12:35:42 -0600
commite0748030863e158ced48802ea42b27e5ec26995f (patch)
tree80eedf3a48eef2037a5e82bab45213da11041112 /gcc/tree-ssa-strlen.c
parente3ba46bd52f9bd6db8788384dd186c9ba5963129 (diff)
downloadgcc-e0748030863e158ced48802ea42b27e5ec26995f.zip
gcc-e0748030863e158ced48802ea42b27e5ec26995f.tar.gz
gcc-e0748030863e158ced48802ea42b27e5ec26995f.tar.bz2
PR tree-optimization/89644 - false-positive -Warray-bounds on strncpy with unterminated array
gcc/ChangeLog: * tree-ssa-strlen.c (handle_builtin_stxncpy): Use full_string_p rather than endptr as an indicator of nul-termination. From-SVN: r269809
Diffstat (limited to 'gcc/tree-ssa-strlen.c')
-rw-r--r--gcc/tree-ssa-strlen.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/tree-ssa-strlen.c b/gcc/tree-ssa-strlen.c
index cf0f70d..a2dc9c7 100644
--- a/gcc/tree-ssa-strlen.c
+++ b/gcc/tree-ssa-strlen.c
@@ -2210,7 +2210,7 @@ handle_builtin_stxncpy (built_in_function, gimple_stmt_iterator *gsi)
if it is known to be nul-terminated. */
if (sidst->nonzero_chars)
{
- if (sidst->endptr)
+ if (sidst->full_string_p)
{
/* String is known to be nul-terminated. */
tree type = TREE_TYPE (sidst->nonzero_chars);
@@ -2236,7 +2236,7 @@ handle_builtin_stxncpy (built_in_function, gimple_stmt_iterator *gsi)
nul if its known to be nul-terminated. */
if (sisrc->nonzero_chars)
{
- if (sisrc->endptr)
+ if (sisrc->full_string_p)
{
tree type = TREE_TYPE (sisrc->nonzero_chars);
srcsize = fold_build2 (PLUS_EXPR, type, sisrc->nonzero_chars,