aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEmmanuel Briot <briot@adacore.com>2007-09-10 14:47:36 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2007-09-10 14:47:36 +0200
commit36df551d433f5e505c7366b50c12d54ca33750b4 (patch)
tree4a236afc8c546253482ea81d8e35e6284fc0c215 /gcc
parentb5c84c3ccf2a576d5681337787c2ed02ff8b6845 (diff)
downloadgcc-36df551d433f5e505c7366b50c12d54ca33750b4.zip
gcc-36df551d433f5e505c7366b50c12d54ca33750b4.tar.gz
gcc-36df551d433f5e505c7366b50c12d54ca33750b4.tar.bz2
s-regpat.adb (Parse_Character_Class): Fix handling of empty character classes ("[]").
2007-09-10 Emmanuel Briot <briot@adacore.com> * s-regpat.adb (Parse_Character_Class): Fix handling of empty character classes ("[]"). From-SVN: r128333
Diffstat (limited to 'gcc')
-rwxr-xr-xgcc/ada/s-regpat.adb4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/ada/s-regpat.adb b/gcc/ada/s-regpat.adb
index c1e9247..2441271 100755
--- a/gcc/ada/s-regpat.adb
+++ b/gcc/ada/s-regpat.adb
@@ -1457,6 +1457,10 @@ package body System.Regpat is
elsif not In_Range then
Last_Value := Value;
+ if Parse_Pos > Expression'Last then
+ Fail ("Empty character class []");
+ end if;
+
if Expression (Parse_Pos) = '-'
and then Parse_Pos < Parse_End
and then Expression (Parse_Pos + 1) /= ']'