diff options
author | Andrew MacLeod <amacleod@redhat.com> | 2022-11-29 13:07:28 -0500 |
---|---|---|
committer | Andrew MacLeod <amacleod@redhat.com> | 2022-12-02 11:50:05 -0500 |
commit | 76dd48f8956b5e17adf0ae1cd1ed3d804a005470 (patch) | |
tree | e3dec229a8348bf01153d3505661220d0745b781 /gcc/c-family | |
parent | 6d3c634c8baebd9ff12c39d61947752486758bd3 (diff) | |
download | gcc-76dd48f8956b5e17adf0ae1cd1ed3d804a005470.zip gcc-76dd48f8956b5e17adf0ae1cd1ed3d804a005470.tar.gz gcc-76dd48f8956b5e17adf0ae1cd1ed3d804a005470.tar.bz2 |
Fix a few incorrect accesses.
This consists of 3 changes which stronger type checking has indicated
are incorrect.
gcc/
* fold-const.cc (fold_unary_loc): Check TREE_TYPE of node.
(tree_invalid_nonnegative_warnv_p): Likewise.
gcc/c-family/
* c-attribs.cc (handle_deprecated_attribute): Use type when
using TYPE_NAME.
Diffstat (limited to 'gcc/c-family')
-rw-r--r-- | gcc/c-family/c-attribs.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/c-family/c-attribs.cc b/gcc/c-family/c-attribs.cc index 07bca68..b36dd97 100644 --- a/gcc/c-family/c-attribs.cc +++ b/gcc/c-family/c-attribs.cc @@ -4240,7 +4240,7 @@ handle_deprecated_attribute (tree *node, tree name, if (type && TYPE_NAME (type)) { if (TREE_CODE (TYPE_NAME (type)) == IDENTIFIER_NODE) - what = TYPE_NAME (*node); + what = TYPE_NAME (type); else if (TREE_CODE (TYPE_NAME (type)) == TYPE_DECL && DECL_NAME (TYPE_NAME (type))) what = DECL_NAME (TYPE_NAME (type)); |