diff options
author | Emmanuel Briot <briot@adacore.com> | 2007-09-10 14:47:36 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2007-09-10 14:47:36 +0200 |
commit | 36df551d433f5e505c7366b50c12d54ca33750b4 (patch) | |
tree | 4a236afc8c546253482ea81d8e35e6284fc0c215 /gcc | |
parent | b5c84c3ccf2a576d5681337787c2ed02ff8b6845 (diff) | |
download | gcc-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-x | gcc/ada/s-regpat.adb | 4 |
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) /= ']' |