<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/131015>131015</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang Crash
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
scober
</td>
</tr>
</table>
<pre>
I am writing an LLVM pass for the first time and so it is entirely possible that I am doing something wrong, but clang asked me to file a bug report (and it said PLEASE) so I am filing one.
The little context that I have is that my LLVM pass seemed to run fine until I started calling `getFirstInsertionPt()`. My pass doesn't do anything useful, it just tries to insert a call to a C function that I wrote at the beginning of every function in the source (the function that I wrote also does not do anything useful). Please let me know if there is any more information I can provide!
[preprocessed-c.txt](https://github.com/user-attachments/files/19216317/preprocessed-c.txt)
[run-script.txt](https://github.com/user-attachments/files/19216319/run-script.txt)
[stack_trace.txt](https://github.com/user-attachments/files/19216318/stack_trace.txt)
[bad-pass-cpp.txt](https://github.com/user-attachments/files/19216331/bad-pass-cpp.txt)
[function-that-pass-inserts-into-programs-c.txt](https://github.com/user-attachments/files/19216346/function-that-pass-inserts-into-programs-c.txt)
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyslFFr5DYQxz-N9mXYxZbXu9aDH3K5MwRyEGjpa5Hlsa2LLBnNeHP77Yu0Xa6koVDIiyUL6f-b-c8wmshOHrEV9RdRf93pjecQWzKhx7jrw3Btn0Av8BYtWz-B9vD8_Md3WDURjCECzwijjcTAdkHQfgAKYBksAXq2Ed0V1kBke4fAs2bIgkNIchQW5Dnt3mLwk5CP0G8MxunEolccYEHgAKN1CBr6bYKIa4gMQjYJZhlI2wFenr89_PZNSJXwmTBal4SDx4MoHkTx8PuM4CyzQzDBM_7kezyzvmAKOP8u13-kSIgLDimCuHkYrUfYPFsHT0CsI-MARrsMEqdiQu6SF0-eMLIN_oWFbIRU4lQc4Pv1pjkEJC_kmWEIoP31ZsBGOG4uOWAZfmzJ0GiREtpmOdAZlQ40PMK4eZMQ9xzeYmAEzbkiPU7W-5z-CHjBeP113_p8hcIWDSYbcwk_VnMUcrjgw8fRqgO8ONSE4JBTrV59eAM7JkTMnmp_hSWkvR9DXHSmPIHRHtYYLnZAIctbgUT9ZY24xmCQCIe9OfBPFvVXIZuZeSVRPQjZCdlNluetP5iwCNlthHGvmbWZF_RMQnapW9JaKlmeqvIsZPeBsFQ3Ztz8nky0K38STwnZvRO9s4i1ef2Tozb4SbBGyO696p3W62GfWm5v1vVzcFUpZPcv2Tvv3kX71EW3K7feTSuH_RrDFPVCn1XZ4ykd_T-oVLuhrQZVKb3Dtjwfy6Y4nxq1m1vE6nyqi9PYnytZmaZXfV2Mqqx6pZVS_c62spB1UZWyVLIp1EGp6jj26dscy7oZxbHARVt3cO6yHEKcdpZow7asyqKsd0736CjPWinzkBNSprEb2_Rg328TiWPhLDH9kmDLDtvHPBMfo6Z5t0XX_odv6eXfS8r-BxoWssuRZO9uwVxa-VcAAAD__3uUAJU">