Stack overflow during regex matching
EDIT: Discussion below identified that the actual problem is the ancient regex implementation using recursion instead of iteration, so a stack overflow can occur on some regex/input pairs. #17686 has been opened to consider replacements for the regex infrastructure.
Please find attached a minimalistic CMake project to reproduce this crash. I tried to simplify the project even further, but the crash wasn't reproducable any longer.
CMake 3.9.6 processes this project without any problems.