summaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/decl.c
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2017-12-13 09:05:48 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2017-12-13 09:05:48 +0000
commitd120a78795ab8594685ceabd4e9d2e1b9e55fff2 (patch)
treeff78fefb62102ca9190b97bde4fb54a52973944d /gcc/ada/gcc-interface/decl.c
parentc08f595db0dfb6678e40fe141716aa90c9f1808c (diff)
* gcc-interface/decl.c (gnat_to_gnu_entity): Robustify test for types
descendant of System.Address. (gnat_to_gnu_subprog_type): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@255600 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
-rw-r--r--gcc/ada/gcc-interface/decl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index e057749e9566..0031196e3bf2 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -653,7 +653,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
{
@@ -5807,7 +5807,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);
@@ -5974,7 +5974,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);