<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/57456>57456</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            crash on deeply nested parentheses in input 
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          jciena
      </td>
    </tr>
</table>

<pre>
    I am using clang version 13.0.0 on windows, from the castxml project. It crashes with deeply nested parentheses such as:
```
(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+
1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1) };
```

I tried to use -fbracket-depth=500 and 1000 but it makes no difference, error still occurs:

```
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0.      Program arguments: castxml.exe --castxml-gccxml -o output.xml --castxml-cc-msvc-c cl .\\input.c -fbracket-depth=1000
1.      .\input.c:1:194: current parser token '('

PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0.      Program arguments: castxml.exe --castxml-gccxml -o output.xml --castxml-cc-msvc-c cl .\\input.c
1.      .\input.c:1:194: current parser token '('
```
Is there a fix or workaround for that?


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJztWE1vozAQ_TXmMgIZCAkcOKRNK0XaQ6X-AmMGcAM2sk3T_vsdSLYfUrWXXWlXu0QTnic248djFPGoTP1aHkEMMDmlW5C9oOMzWqeMhjiNeMSBRmela3N2LLmFxpoBfIcghfMvQw-jNU8ofQRHD9IK16Gj9b6DGnHsX0Gj81jDKCxqOs_RtJtkB8KxdM_4gfE92_JrXNIkX2ONX4mYJQVLblZYYYUVVlhhhX8PLs-LfwWVFVb4owBsd2DpzdeOajkewVtFVswbsnsIYVNZIU_owxpH37H0kHEOQtcQcxpUkwflYRAncmzaQK2aBsnDSZxtIFprLDiv-h6MlJP94Oa-YvDw7W7_eEfOrxqoqKDqLVgcjfUznc77cSmQ3FPQnIv6_nmIjG0pXzgpLfupxov1nG0mVETe0xVgdNni0dMPUE_D-EaFR7B8HqxpLblcYdtpIBs67_XDwEb4QlqE1yxspZxdbWjATH6cfLRkb9NShoN7lqEkrwwRy24plJ7XyS8EnYW8_kddmUTv64lDPH-LzcJmsrNBnn2yQ0uinFADS3aLn9l9VPY_kPJ3ava5D49uvmyLpFujXoB6-GzsSVgzkTANpb4TnqX3HwUPsIy32zgv4jyPg7pM6yItROCV77G8CGj0T153KA0LfQgm25efb1CrfDdVkTQDJfONukJ4fa1CqXJuQkeDbLfJtkFXxljkfLPdiF0VkxL5tsa4qXhRVAWvMmyCXlTYu5JlNyxJNJ5hKUFjlh0CVSY8SXie8oSnOY-jtM6KpigSUSfxrsIt23AchOrf-iaw5UJpbiaa7JXz700VCOdUqxGX7ai-mHxnbPkkFWoRLDuXC_PvX-4rgw">