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 416d5d8..b1f0599 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