diff options
author | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2020-05-09 23:08:18 +0200 |
---|---|---|
committer | Giuliano Belinassi <giuliano.belinassi@usp.br> | 2020-08-17 12:58:12 -0300 |
commit | af2b3d9ed8fec30f13b9330dbf478137d13ca315 (patch) | |
tree | 3a95220a26b7cab95e4c5a206651840e68c817de | |
parent | 646e4a1e53a547ed5ad1686d11a0ea9c5bfee3d1 (diff) | |
download | gcc-af2b3d9ed8fec30f13b9330dbf478137d13ca315.zip gcc-af2b3d9ed8fec30f13b9330dbf478137d13ca315.tar.gz gcc-af2b3d9ed8fec30f13b9330dbf478137d13ca315.tar.bz2 |
Add assertion for access attributes
* gcc-interface/trans.c (Attribute_to_gnu) <Attr_Access>: Assert
that the prefix is not a type.
-rw-r--r-- | gcc/ada/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/trans.c | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 538973e..5e83726 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,10 @@ 2020-05-09 Eric Botcazou <ebotcazou@adacore.com> + * gcc-interface/trans.c (Attribute_to_gnu) <Attr_Access>: Assert that + the prefix is not a type. + +2020-05-09 Eric Botcazou <ebotcazou@adacore.com> + * gcc-interface/ada-tree.h (TYPE_PACKED_ARRAY_TYPE_P): Rename into... (TYPE_BIT_PACKED_ARRAY_TYPE_P): ...this. (TYPE_IS_PACKED_ARRAY_TYPE_P): Rename into... diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index a2f06d7..48c0380 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -2302,6 +2302,9 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute) case Attr_Access: case Attr_Unchecked_Access: case Attr_Code_Address: + /* Taking the address of a type does not make sense. */ + gcc_assert (TREE_CODE (gnu_prefix) != TYPE_DECL); + gnu_result_type = get_unpadded_type (Etype (gnat_node)); gnu_result = build_unary_op (((attribute == Attr_Address |