From 36df551d433f5e505c7366b50c12d54ca33750b4 Mon Sep 17 00:00:00 2001 From: Emmanuel Briot Date: Mon, 10 Sep 2007 14:47:36 +0200 Subject: [PATCH] s-regpat.adb (Parse_Character_Class): Fix handling of empty character classes ("[]"). 2007-09-10 Emmanuel Briot * s-regpat.adb (Parse_Character_Class): Fix handling of empty character classes ("[]"). From-SVN: r128333 --- gcc/ada/s-regpat.adb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gcc/ada/s-regpat.adb b/gcc/ada/s-regpat.adb index c1e924797eb..2441271f0e5 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) /= ']'