]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Set constraint error on real division just like on integer division
authorPiotr Trojanek <trojanek@adacore.com>
Fri, 8 Jan 2021 13:31:25 +0000 (14:31 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 5 May 2021 08:18:58 +0000 (04:18 -0400)
gcc/ada/

* sem_eval.adb (Eval_Arithmetic_Op): Call
Set_Raises_Constraint_Error on real division by zero just like
it is called for integer division by zero earlier in this
routine.

gcc/ada/sem_eval.adb

index 8f3cbf052e98ed01ffd148508cd41bfb36f68f8b..87a2f1f916b704ffc67bc581d6f44e8d5397be3a 100644 (file)
@@ -2226,6 +2226,7 @@ package body Sem_Eval is
                if UR_Is_Zero (Right_Real) then
                   Apply_Compile_Time_Constraint_Error
                     (N, "division by zero", CE_Divide_By_Zero);
+                  Set_Raises_Constraint_Error (N);
                   return;
                end if;