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

    <tr>
        <th>Summary</th>
        <td>
            [lldb][Expression] Printing union with self-referencing member field crashes lldb
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            lldb
      </td>
    </tr>

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

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

<pre>
    ```
//struct DependentDylibAttributes // << this works                 
union DependentDylibAttributes // << this crashes                  

    static const DependentDylibAttributes regular;                 
}; 
 
const DependentDylibAttributes DependentDylibAttributes::regular{};
 
int main() { 
    DependentDylibAttributes d; 
    return 0; 

```

```
clang++ dyld.cpp -g -O0 -std=c++2a
./bin/lldb a.out -o "br se -p return -X main" -o run -o "frame var d"
```
(on llvm.org lldb build at commit `0bfaed8c612705cfa8c5382d26d8089a0a26386b`)

This will infinitely recurse in `ASTContext::getASTRecordLayout`. Possibly the same crash as:
* https://github.com/llvm/llvm-project/issues/43604
* https://github.com/llvm/llvm-project/issues/63667
* https://github.com/llvm/llvm-project/issues/64628
* https://github.com/llvm/llvm-project/issues/66335
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyslM2O2zYQx5-GvgxsUKREyQcd7FV9atGg2UOv_BhJbCnSIKlN_PaFZLmbpNkWRVYQQGKG_M0H_xiZkh08YkuqM2HsF6tHia7gNWGMVN1OznkMsX2171Qwt5YIuv20I_RE2IWwS8px1hk6vKI36HN3c1adco5WzRkT3E8B4U-EP0EebYJPIf6Z4NvvDp29Df5_0XSUacR_8jYgqc_bbrGlLLPVoINP_5JzxGF2MhJ-fhPaLc6Ne1_-g_mWg_AT4adHxPp8R39Ftj7DJK0nrCHsCF9X9GZA80WGABAxz9EDfbWSunvsvnnY7xm1k34g7EzYGczNmYO-XmE_wP5XCvuUDeGdvruZvN84EHZRS9YX54wCeQhzhn0AwpiKkBD210dW-9-3AtlyIM5-O9dHOSG8yAhmkeZ3k2VN8ODcy3QIcYA1lJqtMyAz6DBNNgMRlKpeomm0KFhNK93LRle8YYYJ09DmKKlkgjdCLVx2_LIPz6tkrXNgfW-9zehuEFHPMSFYv8BPH5-fgs_4Od9fc8B8-vj8G-oQzc_yFuZMBD3Ah5CSVe4GeURIS2WrdkGuItiqOcGY83W1rFofbB5nddBhWhv58lj21xj-QJ0Ju9iUZkyEXUouaPkeIMGFqN8FVArWvAtIcF7tTMvNkR_lDttCHAWvqoLx3dgiNnVJGROqoliaQqM46kKVPfaK173e2ZZRxgtKeVGXVXE8aK0qahpalExxUzWkpDhJ6w4PJe3W0K1oCl7tnFTo0jYuF4ltgzK2a75qHhIpqbMpp1dAttmtI3a9UHWkOv_0-RoxJRs8qTr4EK3P1g9wH3qfbB4hoev3EXuM6PXim3BSGKG36Mzfs24h7ubo2h9o6FLYXwEAAP__L9LRxg">