aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/s-valint.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/s-valint.adb')
-rw-r--r--gcc/ada/s-valint.adb10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/ada/s-valint.adb b/gcc/ada/s-valint.adb
index 8bfb3733d4b..60c761fdfd3 100644
--- a/gcc/ada/s-valint.adb
+++ b/gcc/ada/s-valint.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2006, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -57,7 +57,13 @@ package body System.Val_Int is
begin
Scan_Sign (Str, Ptr, Max, Minus, Start);
- Uval := Scan_Unsigned (Str, Ptr, Max);
+
+ if Str (Ptr.all) not in '0' .. '9' then
+ Ptr.all := Start;
+ raise Constraint_Error;
+ end if;
+
+ Uval := Scan_Raw_Unsigned (Str, Ptr, Max);
-- Deal with overflow cases, and also with maximum negative number