diff options
Diffstat (limited to 'gcc/ada/checks.adb')
-rw-r--r-- | gcc/ada/checks.adb | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb index dcfcaa3..0b3ae02 100644 --- a/gcc/ada/checks.adb +++ b/gcc/ada/checks.adb @@ -750,7 +750,7 @@ package body Checks is -- mode then just skip the check (it is not required in any case). when RE_Not_Available => - return; + null; end Apply_Address_Clause_Check; ------------------------------------- @@ -1078,7 +1078,7 @@ package body Checks is exception when RE_Not_Available => - return; + null; end; end Apply_Arithmetic_Overflow_Strict; @@ -6437,8 +6437,6 @@ package body Checks is if Debug_Flag_CC then w (" exception occurred, overflow flag set"); end if; - - return; end Enable_Overflow_Check; ------------------------ @@ -6686,8 +6684,6 @@ package body Checks is if Debug_Flag_CC then w (" exception occurred, range flag set"); end if; - - return; end Enable_Range_Check; ------------------ @@ -7091,8 +7087,6 @@ package body Checks is end loop; -- If we fall through entry was not found - - return; end Find_Check; --------------------------------- @@ -8163,6 +8157,7 @@ package body Checks is end if; declare + Decl : Node_Id; CE : Node_Id; PV : Node_Id; Var_Id : Entity_Id; @@ -8215,12 +8210,20 @@ package body Checks is Mutate_Ekind (Var_Id, E_Variable); Set_Etype (Var_Id, Typ); - Insert_Action (Exp, + Decl := Make_Object_Declaration (Loc, Defining_Identifier => Var_Id, Object_Definition => New_Occurrence_Of (Typ, Loc), - Expression => New_Copy_Tree (Exp)), - Suppress => Validity_Check); + Expression => New_Copy_Tree (Exp)); + + -- We might be validity-checking object whose type is declared as + -- limited but completion is a scalar type. We need to explicitly + -- flag its assignment as OK, as otherwise it would be rejected by + -- the language rules. + + Set_Assignment_OK (Decl); + + Insert_Action (Exp, Decl, Suppress => Validity_Check); Set_Validated_Object (Var_Id, New_Copy_Tree (Exp)); |