Commit 675d6070 by Thomas Quinot Committed by Arnaud Charlet

checks.ads, checks.adb (Selected_Range_Checks): No range check is required for a…

checks.ads, checks.adb (Selected_Range_Checks): No range check is required for a conversion between two...

2007-04-06  Thomas Quinot  <quinot@adacore.com>
	    Ed Schonberg  <schonberg@adacore.com>
	    Gary Dismukes  <dismukes@adacore.com>

	* checks.ads, checks.adb (Selected_Range_Checks): No range check is
	required for a conversion between two access-to-unconstrained-array
	types.
	(Expr_Known_Valid): Validity checks do not apply to discriminants, but
	to discriminant constraints on discriminant objects. This rule must
	apply as well to discriminants of protected types in private components.
	(Null_Exclusion_Static_Checks): If No_Initialization is set on an
	object of a null-excluding access type then don't require the
	the object declaration to have an expression and don't emit a
	run-time check.

From-SVN: r123554
parent 4cd52f5e
...@@ -264,6 +264,12 @@ package Checks is ...@@ -264,6 +264,12 @@ package Checks is
-- this node is further examined depends on the setting of -- this node is further examined depends on the setting of
-- the parameter Source_Typ, as described below. -- the parameter Source_Typ, as described below.
-- ??? Apply_Length_Check and Apply_Range_Check do not have an Expr
-- formal
-- ??? Apply_Length_Check and Apply_Range_Check have a Ck_Node formal
-- which is undocumented, is it the same as Expr?
-- Target_Typ The target type on which the check is to be based. For -- Target_Typ The target type on which the check is to be based. For
-- example, if we have a scalar range check, then the check -- example, if we have a scalar range check, then the check
-- is that we are in range of this type. -- is that we are in range of this type.
...@@ -311,7 +317,7 @@ package Checks is ...@@ -311,7 +317,7 @@ package Checks is
(Ck_Node : Node_Id; (Ck_Node : Node_Id;
Target_Typ : Entity_Id; Target_Typ : Entity_Id;
Source_Typ : Entity_Id := Empty); Source_Typ : Entity_Id := Empty);
-- For an Node of kind N_Range, constructs a range check action that tests -- For a Node of kind N_Range, constructs a range check action that tests
-- first that the range is not null and then that the range is contained in -- first that the range is not null and then that the range is contained in
-- the Target_Typ range. -- the Target_Typ range.
-- --
......
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