+2018-05-25 Nicolas Roche <roche@adacore.com>
+
+ * libgnat/s-valrea.adb (Scan_Real): Abort computation once it is sure
+ that the result will be either -infinite or +infinite.
+
2018-05-25 Patrick Bernardi <bernardi@adacore.com>
* libgnat/s-parame.ads, libgnat/s-parame__vxworks.ads,
-- For base 10, use power of ten table, repeatedly if necessary
elsif Scale > 0 then
- while Scale > Maxpow loop
+ while Scale > Maxpow and then Uval'Valid loop
Uval := Uval * Powten (Maxpow);
Scale := Scale - Maxpow;
end loop;
-- Note that we still know that Scale > 0, since the loop
-- above leaves Scale in the range 1 .. Maxpow.
- Uval := Uval * Powten (Scale);
+ if Uval'Valid then
+ Uval := Uval * Powten (Scale);
+ end if;
elsif Scale < 0 then
- while (-Scale) > Maxpow loop
+ while (-Scale) > Maxpow and then Uval'Valid loop
Uval := Uval / Powten (Maxpow);
Scale := Scale + Maxpow;
end loop;
-- Note that we still know that Scale < 0, since the loop
-- above leaves Scale in the range -Maxpow .. -1.
-
- Uval := Uval / Powten (-Scale);
+ if Uval'Valid then
+ Uval := Uval / Powten (-Scale);
+ end if;
end if;
-- Here is where we check for a bad based number