[Ada] Return a valid value when handling Constraint_Error

Pierre-Marie de Rodat derodat@adacore.com
Tue Nov 9 09:45:58 GMT 2021


We hit the Constraint_Error because Start_Column is outside bounds.  So
it should not be returned because that will again raise a
Constraint_Error. Instead return its type'Last which is then properly
handled.

Also reformat the Blanks_Loop to be a simple loop.  It seems, the nested
if's were written for performance consideration.  This does not seem do
be relevant anymore.

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

gcc/ada/

	* scng.adb (Set_Start_Column): Return Column_Number'Last when
	handling Constraint_Error. Plus reformat a strangely 7 level if
	loop.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 2866 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20211109/970d25eb/attachment.bin>


More information about the Gcc-patches mailing list