uintp.adb (UI_GCD): Fix potential overflow
authorRobert Dewar <dewar@adacore.com>
Wed, 30 Jul 2008 15:53:08 +0000 (17:53 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Wed, 30 Jul 2008 15:53:08 +0000 (17:53 +0200)
2008-07-30  Robert Dewar  <dewar@adacore.com>

* uintp.adb (UI_GCD): Fix potential overflow

From-SVN: r138323

gcc/ada/uintp.adb

index 416d5d88681b9e3d10c3ef1025581e8e4e792cfd..b1f0599360820d52a993b215a31e3a8a095699c9 100644 (file)
@@ -1832,7 +1832,7 @@ package body Uintp is
 
             Den1 := V_Hat + C;
             Den2 := V_Hat + D;
-            exit when (Den1 * Den2) = Int_0;
+            exit when Den1 = Int_0 or else Den2 = Int_0;
 
             --  Compute Q, the trial quotient