diff options
author | Michael Matz <matz@suse.de> | 2018-04-04 14:49:06 +0000 |
---|---|---|
committer | Michael Matz <matz@gcc.gnu.org> | 2018-04-04 14:49:06 +0000 |
commit | f1acdcd066f3ba2a4565a9e8a002af897161483d (patch) | |
tree | 7e5d7bc4e8ce12d0b5d26478dd6693af9c618432 /gcc/builtins.c | |
parent | eefecf6546957c92ab0073c0e6072c9554f19566 (diff) | |
download | gcc-f1acdcd066f3ba2a4565a9e8a002af897161483d.zip gcc-f1acdcd066f3ba2a4565a9e8a002af897161483d.tar.gz gcc-f1acdcd066f3ba2a4565a9e8a002af897161483d.tar.bz2 |
Fix -Wstringop-overflow regression
we shouldn't claim string overflows for character arrays at
end of structures; the code that tries to avoid these
accidentally passed the address of the accessed member to
array_at_struct_end_p(), but that one wants the component_ref
or array_ref itself. Needs updating of one testcase that
incorrectly expected warning to occur in this situation.
From-SVN: r259083
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r-- | gcc/builtins.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c index e0f6c2a..ababee5 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -3377,7 +3377,7 @@ compute_objsize (tree dest, int ostype) type = TYPE_MAIN_VARIANT (type); if (TREE_CODE (type) == ARRAY_TYPE - && !array_at_struct_end_p (dest)) + && !array_at_struct_end_p (TREE_OPERAND (dest, 0))) { /* Return the constant size unless it's zero (that's a zero-length array likely at the end of a struct). */ |