This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] No tampering check for empty container

AI05-0022 requires that tampering checks be performed in order to detect
manipulation of the container via generic actual subprograms. (In the case of
the ordered maps, that would occur through generic operators "<" for Key_Type
and "=" for Element_Type.)

However, for an empty container, no such check is strictly required, as we
obtain the result without having to invoke any generic formal subprograms
(because there are no elements). To ensure that there is no unnecessary
manipulation of container state, we handle an empty container as a special
case, and return a result immediately, without performing a tampering check.

Tested on x86_64-pc-linux-gnu, committed on trunk

2013-04-25  Matthew Heaney  <>

	* a-rbtgbo.adb, a-crbtgo.adb (Generic_Equal): do not test for
	tampering when container empty.
	* a-crbtgk.adb (Ceiling, Find, Floor): ditto.
	(Generic_Conditional_Insert, Generic_Conditional_Insert_With_Hint):

Attachment: difs
Description: Text document

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]