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

    <tr>
        <th>Summary</th>
        <td>
            [clang][StaticAnalyzer] Crash on loop unrolling mode
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

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

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

<pre>
    ```c
// test.c
// unroll-loops=true

void test_escaping_on_var_before_switch_case_no_crash(int c) {
  switch (c) {
    int i;
  case 0: {
    for (i = 0; i < 16; i++) {}
 break;
  }
  }
}
```
crash dump:
```c
Reached root without finding the declaration of VD
UNREACHABLE executed at /home/xxxxx/Sources/llvm-project-main/clang/lib/StaticAnalyzer/Core/LoopUnrolling.cpp:248!
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxcU02PozgQ_TXFxerImIDhwCEJjfbQ2kOveq_ImAK8a-zINv0xv35kwkymgyxUuF49_F6VhfdqMog15GfIm0SsYbauHoRRnyWlSW-HrxoKelsSaAP0BKwF1pKAPhy-b63GWa2ftLVXD1kT3Ip7fnu_WzVsZR16Ka7KTJ013btwXY-jddj5DxXk3EnhsTO2k074GVipTCASWEWAn29MhNygBFj5mCEk4hVkv3ciH6GQnb7DRutivSKQNTF9JjG8kLTYYmDnbd3IebMX9g7F_3-Q3zP38B78su72uQkiw7pcITs9IHYnX1HIGQfirA3kQ4XZroGMygzKTCTMSAaUWjgRlDXEjuTf_U9vf78-ny5_nc4vzwQ_Ua4BByICAdbOdkFg7Wd8gLX_2NVJ9MBard-Xp6uz_6EMT4tQBlgrtTBTzKk-YoMISp6M0F8_0AFrL9ZFrhdrr29bs5WZDvIa9bBjCSx9UJUMdTZUWSUSrNOi4vSYFZwnc837kRYjFlwImbNKyjKnWZYdyyNjfVWViaoZZVlK0zTlNE2LQ87TvhCc87SvKl6McKS4CKUPUcbBuilR3q9YF2WZVokWPWq_zTVjuygWR9zVm-x-nTwcqVY--DtDUEFvl-FWkTeQnx88yBty2dpoDYmDvg99bM9iB0xWp-s5hHgB9msxqTCv_UHaZff8wXpg7Xby2JLt8D8DAAD__6-pEBI">