[Ada] Fix Constraint error on rexgexp close bracket find algorithm

Pierre-Marie de Rodat derodat@adacore.com
Wed Nov 10 08:58:30 GMT 2021

In pattern syntax checking, make a procedure out of the algorithm to
find the close bracket matching an open bracket. Fix cases where the
close bracket is missing in the special cases '-' and '\', e.g.:

- "[a-b"
- "[\b"
- "[\]" misses either a backslash or a close bracket

These three cases would raise constraint errors.

Tested on x86_64-pc-linux-gnu, committed on trunk


	* libgnat/s-regexp.adb (Check_Well_Formed_Pattern): Fix
	Constraint_Error on missing close bracket.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 5681 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20211110/b2f2f925/attachment.bin>

More information about the Gcc-patches mailing list