aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2017-12-13 09:05:07 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2017-12-13 09:05:07 +0000
commita3fc8f169fc51d7774c6217056532b2540ce7290 (patch)
tree39b9b78535a82e5febc6a21a0a8ac90cbd84b985
parentb8d7e076ed0cf5fde5f5d875e4145d63317a6180 (diff)
downloadgcc-a3fc8f169fc51d7774c6217056532b2540ce7290.zip
gcc-a3fc8f169fc51d7774c6217056532b2540ce7290.tar.gz
gcc-a3fc8f169fc51d7774c6217056532b2540ce7290.tar.bz2
decl.c (gnat_to_gnu_entity): Robustify test for types descendant of System.Address.
* gcc-interface/decl.c (gnat_to_gnu_entity): Robustify test for types descendant of System.Address. (gnat_to_gnu_subprog_type): Likewise. From-SVN: r255599
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/gcc-interface/decl.c6
2 files changed, 9 insertions, 3 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index c676e7b..70c596e 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,9 @@
+2017-12-13 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/decl.c (gnat_to_gnu_entity): Robustify test for types
+ descendant of System.Address.
+ (gnat_to_gnu_subprog_type): Likewise.
+
2017-12-08 Jakub Jelinek <jakub@redhat.com>
* gcc-interface/utils.c (gnat_internal_attribute_table): Add
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 77515c0..f626e61 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -659,7 +659,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
/* Get the type after elaborating the renamed object. */
if (Has_Foreign_Convention (gnat_entity)
- && Is_Descendant_Of_Address (gnat_type))
+ && Is_Descendant_Of_Address (Underlying_Type (gnat_type)))
gnu_type = ptr_type_node;
else
{
@@ -5594,7 +5594,7 @@ gnat_to_gnu_subprog_type (Entity_Id gnat_subprog, bool definition,
/* For foreign convention subprograms, return System.Address as void *
or equivalent. Note that this comprises GCC builtins. */
if (Has_Foreign_Convention (gnat_subprog)
- && Is_Descendant_Of_Address (gnat_return_type))
+ && Is_Descendant_Of_Address (Underlying_Type (gnat_return_type)))
gnu_return_type = ptr_type_node;
else
gnu_return_type = gnat_to_gnu_profile_type (gnat_return_type);
@@ -5761,7 +5761,7 @@ gnat_to_gnu_subprog_type (Entity_Id gnat_subprog, bool definition,
/* For foreign convention subprograms, pass System.Address as void *
or equivalent. Note that this comprises GCC builtins. */
if (Has_Foreign_Convention (gnat_subprog)
- && Is_Descendant_Of_Address (gnat_param_type))
+ && Is_Descendant_Of_Address (Underlying_Type (gnat_param_type)))
gnu_param_type = ptr_type_node;
else
gnu_param_type = gnat_to_gnu_profile_type (gnat_param_type);