<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/95720>95720</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang 17 crashes on null pointer deref while generating debuginfo
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
mcy
</td>
</tr>
</table>
<pre>
I have made minimal attempts to debug this; I have only done enough to determine this is due to a null deref in `clang::CodeGen::CGDebugInfo::getOrCreateType()`.
```
clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/mcyoung/projects/best/external/toolchains_llvm~~llvm~llvm_llvm/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/12
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/12
Candidate multilib: .;@m64
Selected multilib: .;@m64
```
[result_test-eacb02.cpp](https://github.com/user-attachments/files/15859786/result_test-eacb02.cpp.txt)
[result_test-eacb02.sh](https://github.com/user-attachments/files/15859787/result_test-eacb02.sh.txt)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0VE2PpDYQ_TXui9XIGDBw4NDTLUZzyiF7Hxm7GpwYu2WXZ7sv-9sjPrLZrEYjRZmVUFmmivdelagnYzSjA-hI9USqy0EmnHzoZvU4DF4_uhc6yTegs9RAZ-PMLC2ViDDfMFL0VMOQRoqTiaR4onu1d_ZBtXdAwfk0TlshQpiNg7WYmkh1giUhqUvWUg0BrtQ4SgRTVrqRFCdSnM5ewzO4_fJ8Wehe3NVvL0bA38I5gET48rgB4Q3hLREsI-xC2GmPgu3Pel3B6RuEaLyjeZ2xTFDCmwnxFhdY3hPejwanNGTKz4T31r79fRxvwf8BCqlgrK1ZM5SFqPM6V0oP13KoWlapQciGFXVVXCFfBa28X2QYAUlxovdGvIrymNyfzn91R2tcuh9Hl_a6KYDUdPYa7FJ989Hct9SLiyitBX0xYUkR3k9-BsL7WT18ciPh_a4vEt4PEJHwHu4IwUlLeI_eWzVJ4-Lr0sy3b2tcwuve42DcxtX75DRV0mmjJQJ9Pp-p2fglGu92_hTDMhkzLDNTivDeiEb80BPvm_8JuI_rR8ic_QJM_vmYe-u_gwWFoD9F3_m7sjlZNMtXxYlmpHgiJZtF-RPlR0U_bcYeq6cAMVl8RYh4BKkGxjN1u5Hq8vGapAjhKBGlmmZw6y94NRaWM6-aqq0bQXj_PniGd_y-Ku9LiNMnKKjfVxCnfwk46K7QbdHKA3R5nTdVzfK6OkydZgPn0FZN04LICwG6VEUuhoJDyXLGD6bjjJdM5IKzQuRV1momhqJty6YWZaE5KRnM0thsWbjMh_FgYkzQtVXN2cHKAWxczZjzzQY5X3w5dKv7DGmMpGTWRIz_IKBBC915Nba8pirIOEGk3m3WevPGIYTdYr9OxgIdwUGQaNy4WbhxV39IwXb_zQaXfV_kLxPeOnjr-F8BAAD__1JXAIs">