ada: Turn assertions into defensive code in error locations
commit18ed1bc59391acdad7e80750239b536b3e371d00
authorPiotr Trojanek <trojanek@adacore.com>
Mon, 20 Feb 2023 13:01:36 +0000 (20 14:01 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 23 May 2023 07:59:05 +0000 (23 09:59 +0200)
tree4fb0e6d43b18ca5af13fe4e5d3a9cf3bf9c82058
parent65d2481a4f90f9f2af8b636105d934b2cefa1009
ada: Turn assertions into defensive code in error locations

We pretty-print numeric literals that do not come from source by relying
on their Sloc. This generally works well, but sporadically the Sloc is
set wrongly. We might want to trace and fix such occurrences, but for
now it is simpler to replace an otherwise reasonable assertions with
defensive code.

gcc/ada/

* errout.adb (Last_Sloc): Refactor a heavily repeated "S := S + 1"
statement into a subprogram; replace assertions with defensive code;
fix few more off-by-one errors.
gcc/ada/errout.adb