Check regex timeout in loops and repetitions (dotnet/corefx#38091)
authorViktor Hofer <viktor.hofer@microsoft.com>
Fri, 31 May 2019 18:51:09 +0000 (20:51 +0200)
committerWilliam Godbe <wigodbe@microsoft.com>
Fri, 31 May 2019 18:51:09 +0000 (11:51 -0700)
commitc288357ce6bf97498a556c9d4cbef8e4cb168fd2
tree5d8f1220b14d79c7f1b79b9729d5ff0af4b0d91a
parent968ca88c1efa0e780736e2d0dccc1be3f138a848
Check regex timeout in loops and repetitions (dotnet/corefx#38091)

* Check regex timeout in loops and repetitions

Check the regex timeout in SetLoop and SetRepetition opcodes to avoid
the timeout not being handled.

* PR feedback and fix OOM

Commit migrated from https://github.com/dotnet/corefx/commit/40f031a7c7a8241f92a9f6d7f269dc99228d2893
src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexCompiler.cs
src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexInterpreter.cs
src/libraries/System.Text.RegularExpressions/tests/Regex.Match.Tests.cs