This is the mail archive of the gcc-patches@gcc.gnu.org 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] Fix index check error in g-dyntab.adb


Tested on i686-linux, committed on trunk

The conversion from Natural to Table_Index_Type was implemented by first
converting Idx (of type Natural) to Table_Index_Type, and then adding that
offset to the lower bound of the array.  But that implementation wasn't quite
correct, since there's no guarantee that Table_Index_Type includes values in
the range of subtype Natural.  (This can happen if Table_Index_Type has only
negative values in its range, for example.)

2006-02-13  Matthew Heaney  <heaney@adacore.com>

	*  g-dyntab.adb (Index_Of): conversion from Natural can no longer raise
	Constraint_Error.

Attachment: difs.54
Description: Text document


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