Commit 36df551d by Emmanuel Briot Committed by Arnaud Charlet

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
parent b5c84c3c
...@@ -1457,6 +1457,10 @@ package body System.Regpat is ...@@ -1457,6 +1457,10 @@ package body System.Regpat is
elsif not In_Range then elsif not In_Range then
Last_Value := Value; Last_Value := Value;
if Parse_Pos > Expression'Last then
Fail ("Empty character class []");
end if;
if Expression (Parse_Pos) = '-' if Expression (Parse_Pos) = '-'
and then Parse_Pos < Parse_End and then Parse_Pos < Parse_End
and then Expression (Parse_Pos + 1) /= ']' and then Expression (Parse_Pos + 1) /= ']'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment