Ada: Implement missing overflow check for Integer_128 in GNATProve mode
Adds overflow checks for universal integer to 128-bit integer conversions in GNATProve to enhance code verification.
Under GNATProve mode, the Ada frontend previously lacked overflow checks for type conversions of universal integer numbers to 128-bit integer types. This commit adds the missing checks, ensuring that conversions are safe and within the valid range of the target type. This enhancement improves the reliability of code verified with GNATProve.
In Details
In GNATProve mode, the Ada compiler performs static analysis to verify code correctness. The absence of overflow checks during universal integer to 128-bit integer conversions could lead to incorrect verification results. This commit modifies checks.adb and sem_eval.adb to include these checks, ensuring more accurate static analysis.
For Context
When converting numbers between different types, especially when dealing with large integers, it's crucial to check for potential overflows. Overflow occurs when the result of a conversion exceeds the representable range of the target type. This commit adds overflow checks in the Ada compiler for conversions involving 128-bit integers, specifically when using the GNATProve tool for code verification, ensuring that such conversions are performed safely and reliably.