[Ada] Indexing error when calling GNAT.Regpat.Match

Pierre-Marie de Rodat derodat@adacore.com
Wed Jul 6 13:31:30 GMT 2022


This patch corrects an error in the compiler whereby a buffer sizing
error fails to get raised when compiling a regex expression with an
insufficiently sized Pattern_Matcher as the documentation indicated.
This, in turn, could lead to indexing errors when attempting to call
Match with the malformed regex program buffer.

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

gcc/ada/

	* libgnat/s-regpat.adb, libgnat/s-regpat.ads (Compile): Add a
	new defaulted parameter Error_When_Too_Small to trigger an
	error, if specified true, when Matcher is too small to hold the
	compiled regex program.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 4107 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20220706/a0276bf9/attachment-0001.bin>


More information about the Gcc-patches mailing list