mirror of git://gcc.gnu.org/git/gcc.git
re PR ada/64057 (possible issue in the shared implementation of Ada.Strings.Unbounded)
2016-10-12 Eric Botcazou <ebotcazou@adacore.com> PR ada/64057 * exp_ch5.adb (Is_Non_Local_Array): Return true for every array that is not a component or slice of an entity in the current scope. From-SVN: r241025
This commit is contained in:
parent
b4a9ef2f4d
commit
f40dbd80eb
|
|
@ -278,9 +278,9 @@ package body Exp_Ch5 is
|
||||||
|
|
||||||
function Is_Non_Local_Array (Exp : Node_Id) return Boolean;
|
function Is_Non_Local_Array (Exp : Node_Id) return Boolean;
|
||||||
-- Determine if Exp is a reference to an array variable which is other
|
-- Determine if Exp is a reference to an array variable which is other
|
||||||
-- than an object defined in the current scope, or a slice of such
|
-- than an object defined in the current scope, or a component or a
|
||||||
-- an object. Such objects can be aliased to parameters (unlike local
|
-- slice of such an object. Such objects can be aliased to parameters
|
||||||
-- array references).
|
-- (unlike local array references).
|
||||||
|
|
||||||
-----------------------
|
-----------------------
|
||||||
-- Apply_Dereference --
|
-- Apply_Dereference --
|
||||||
|
|
@ -327,10 +327,14 @@ package body Exp_Ch5 is
|
||||||
|
|
||||||
function Is_Non_Local_Array (Exp : Node_Id) return Boolean is
|
function Is_Non_Local_Array (Exp : Node_Id) return Boolean is
|
||||||
begin
|
begin
|
||||||
return (Is_Entity_Name (Exp)
|
case Nkind (Exp) is
|
||||||
and then Scope (Entity (Exp)) /= Current_Scope)
|
when N_Indexed_Component | N_Selected_Component | N_Slice =>
|
||||||
or else (Nkind (Exp) = N_Slice
|
return Is_Non_Local_Array (Prefix (Exp));
|
||||||
and then Is_Non_Local_Array (Prefix (Exp)));
|
when others =>
|
||||||
|
return
|
||||||
|
not (Is_Entity_Name (Exp) and then
|
||||||
|
Scope (Entity (Exp)) = Current_Scope);
|
||||||
|
end case;
|
||||||
end Is_Non_Local_Array;
|
end Is_Non_Local_Array;
|
||||||
|
|
||||||
-- Determine if Lhs, Rhs are formal arrays or nonlocal arrays
|
-- Determine if Lhs, Rhs are formal arrays or nonlocal arrays
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue