Commit 2ddc2000 by Arnaud Charlet

[multiple changes]

2009-04-07  Tristan Gingold  <gingold@adacore.com>

	* socket.c: Add more protections against S_resolvLib_ macros.

2009-04-07  Thomas Quinot  <quinot@adacore.com>

	* sem_attr.adb: Minor reformatting

2009-04-07  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch6.adb (New_Overloaded_Entity): New predicate
	Is_Overriding_Alias to handle properly types that inherit two homonym
	operations that have distinct dispatch table entries.

From-SVN: r145681
parent 06a16f58
2009-04-07 Tristan Gingold <gingold@adacore.com>
* socket.c: Add more protections against S_resolvLib_ macros.
2009-04-07 Thomas Quinot <quinot@adacore.com>
* sem_attr.adb: Minor reformatting
2009-04-07 Ed Schonberg <schonberg@adacore.com>
* sem_ch6.adb (New_Overloaded_Entity): New predicate
Is_Overriding_Alias to handle properly types that inherit two homonym
operations that have distinct dispatch table entries.
2009-04-07 Emmanuel Briot <briot@adacore.com> 2009-04-07 Emmanuel Briot <briot@adacore.com>
* s-regexp.adb (Create_Mapping): Ignore excaped open parenthesis when * s-regexp.adb (Create_Mapping): Ignore excaped open parenthesis when
...@@ -5517,7 +5517,7 @@ package body Sem_Attr is ...@@ -5517,7 +5517,7 @@ package body Sem_Attr is
-- an optimization, but it falls out essentially free, so why not. -- an optimization, but it falls out essentially free, so why not.
-- Again we compute the variable Static for easy reference later -- Again we compute the variable Static for easy reference later
-- (note that no array attributes are static in Ada 83). -- (note that no array attributes are static in Ada 83).
-- we also need to set Static properly for subsequent legality checks -- We also need to set Static properly for subsequent legality checks
-- which might otherwise accept non-static constants in contexts -- which might otherwise accept non-static constants in contexts
-- where they are not legal. -- where they are not legal.
......
...@@ -3096,7 +3096,7 @@ package body Sem_Ch6 is ...@@ -3096,7 +3096,7 @@ package body Sem_Ch6 is
if Nkind (Decl) = N_Subprogram_Declaration if Nkind (Decl) = N_Subprogram_Declaration
and then Present (Body_To_Inline (Decl)) and then Present (Body_To_Inline (Decl))
then then
return; -- Done already. return; -- Done already
-- Functions that return unconstrained composite types require -- Functions that return unconstrained composite types require
-- secondary stack handling, and cannot currently be inlined, unless -- secondary stack handling, and cannot currently be inlined, unless
...@@ -6473,6 +6473,15 @@ package body Sem_Ch6 is ...@@ -6473,6 +6473,15 @@ package body Sem_Ch6 is
-- set when freezing entities, so we must examine the place of the -- set when freezing entities, so we must examine the place of the
-- declaration in the tree, and recognize wrapper packages as well. -- declaration in the tree, and recognize wrapper packages as well.
function Is_Overriding_Alias
(Old_E : Entity_Id;
New_E : Entity_Id) return Boolean;
-- Check whether new subprogram and old subprogram are both inherited
-- from subprograms that have distinct dispatch table entries. This can
-- occur with derivations from instances with accidental homonyms.
-- The function is conservative given that the converse is only true
-- within instances that contain accidental overloadings.
------------------------------------ ------------------------------------
-- Check_For_Primitive_Subprogram -- -- Check_For_Primitive_Subprogram --
------------------------------------ ------------------------------------
...@@ -7027,6 +7036,24 @@ package body Sem_Ch6 is ...@@ -7027,6 +7036,24 @@ package body Sem_Ch6 is
end if; end if;
end Is_Private_Declaration; end Is_Private_Declaration;
--------------------------
-- Is_Overriding_Alias --
--------------------------
function Is_Overriding_Alias
(Old_E : Entity_Id;
New_E : Entity_Id) return Boolean
is
AO : constant Entity_Id := Alias (Old_E);
AN : constant Entity_Id := Alias (New_E);
begin
return Scope (AO) /= Scope (AN)
or else No (DTC_Entity (AO))
or else No (DTC_Entity (AN))
or else DT_Position (AO) = DT_Position (AN);
end Is_Overriding_Alias;
-- Start of processing for New_Overloaded_Entity -- Start of processing for New_Overloaded_Entity
begin begin
...@@ -7163,14 +7190,11 @@ package body Sem_Ch6 is ...@@ -7163,14 +7190,11 @@ package body Sem_Ch6 is
if Present (Alias (S)) if Present (Alias (S))
and then (No (Alias (E)) and then (No (Alias (E))
or else Is_Abstract_Subprogram (S)
or else Comes_From_Source (E) or else Comes_From_Source (E)
or else Is_Abstract_Subprogram (S)
or else or else
(Is_Dispatching_Operation (E) (Is_Dispatching_Operation (E)
and then Present (DTC_Entity (Alias (S))) and then Is_Overriding_Alias (E, S)))
and then Present (DTC_Entity (Alias (E)))
and then DT_Position (Alias (S))
= DT_Position (Alias (E))))
and then Ekind (E) /= E_Enumeration_Literal and then Ekind (E) /= E_Enumeration_Literal
then then
......
...@@ -355,15 +355,20 @@ __gnat_get_h_errno (void) { ...@@ -355,15 +355,20 @@ __gnat_get_h_errno (void) {
#ifdef S_resolvLib_HOST_NOT_FOUND #ifdef S_resolvLib_HOST_NOT_FOUND
case S_resolvLib_HOST_NOT_FOUND: case S_resolvLib_HOST_NOT_FOUND:
#endif #endif
case S_hostLib_UNKNOWN_HOST: #ifdef S_hostLib_HOST_NOT_FOUND
case S_hostLib_HOST_NOT_FOUND: case S_hostLib_HOST_NOT_FOUND:
#endif
case S_hostLib_UNKNOWN_HOST:
return HOST_NOT_FOUND; return HOST_NOT_FOUND;
#ifdef S_resolvLib_TRY_AGAIN #ifdef S_resolvLib_TRY_AGAIN
case S_resolvLib_TRY_AGAIN: case S_resolvLib_TRY_AGAIN:
return TRY_AGAIN;
#endif #endif
#ifdef S_hostLib_TRY_AGAIN
case S_hostLib_TRY_AGAIN: case S_hostLib_TRY_AGAIN:
return TRY_AGAIN; return TRY_AGAIN;
#endif
#ifdef S_resolvLib_NO_RECOVERY #ifdef S_resolvLib_NO_RECOVERY
case S_resolvLib_NO_RECOVERY: case S_resolvLib_NO_RECOVERY:
...@@ -377,8 +382,13 @@ __gnat_get_h_errno (void) { ...@@ -377,8 +382,13 @@ __gnat_get_h_errno (void) {
#ifdef S_resolvLib_INVALID_ADDRESS #ifdef S_resolvLib_INVALID_ADDRESS
case S_resolvLib_INVALID_ADDRESS: case S_resolvLib_INVALID_ADDRESS:
#endif #endif
case S_hostLib_INVALID_PARAMETER: #ifdef S_hostLib_NO_RECOVERY
case S_hostLib_NO_RECOVERY: case S_hostLib_NO_RECOVERY:
#endif
#ifdef S_hostLib_NETDB_INTERNAL
case S_hostLib_NETDB_INTERNAL:
#endif
case S_hostLib_INVALID_PARAMETER:
return NO_RECOVERY; return NO_RECOVERY;
#ifdef S_resolvLib_NO_DATA #ifdef S_resolvLib_NO_DATA
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment