<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/62075>62075</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
CFG + ehcont + dyn TLS = crashing output
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
namazso
</td>
</tr>
</table>
<pre>
Repro:
```cpp
#include <cstdio>
class Z {
void* volatile p;
public:
Z() {
p = nullptr;
}
};
thread_local Z g_z;
int main() {
puts("Hello world!");
return 0;
}
```
```
> clang-cl.exe -m64 /guard:cf /guard:ehcont -- test.cpp
> .\test.exe
> echo %errorlevel%
-1073740791
```
The function `__tls_init` is not in the appropriate table, as this fails:
![image](https://user-images.githubusercontent.com/8676443/231281616-9d8f4e46-d540-4168-946f-3912bec46088.png)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8U02P4zYM_TX0hbAhUfLXwYfNZNIeemr3NJdAlhVbhSIZkjz78euLeLIz6aAoYNjWo_j48EiqlOzsjRmgPkB9LNSWlxAHr67qZwrFGKYfw59mjQHEF2BHYL_eDXt79LreERLWa7dNBkE86ZQnG0A8PyZpp1LCF4T28AYgvgY7AX3B1-BUts7gCuLwmLNuo7P6vTriC1AH1D-SIK4I4oh-c27N8Z0BEdrjnaw9vsN5iUZNZxe0cviC8_nnp5rWZ7wq6z9XAtavW047TL8b5wJ-C9FNQByIgPoHnj6avEWP7AN71_LLu_809H4Uz6id8nOpXWW-GyyvjUSg07ypOIH4oi-PJ7Po4DOWJWaTcvXRFPGMFdRPO2q-mw_U6CUgUG1iDNGZV-OA6rdwyVkrWsnanv-P4K-LwcvmdbbBIzTsfM4una23GRqGNqEPGa3HvBhU6xrDGq3KBrManQF6QpUwLzbhRVmXPo8XcagP9qpmA_URqFtyXvdLdAI6bcnEco-marZ52cYbcrPA-FzpcAU6dU3bSCmATiQ4dbzhTdlP3UUa2ZRTLVkpedOVvWwupeg5jUbLhnVdtfr51spdRzENYupFrwoz8KbjJGvey2IZGJed5t1lunTTRcmmH1s-tVzKbmolSSrsQIwEk5wTE4LLalS8b5WsZSs5adGBZOaqrKuce71WIc6FTWkzQ0OsrQunRuPSvpVE3nzDPXibsvpYxOGWU47bnEAyZ1NOHyzZZmeGp9NvCHTA-2DcfqcfHr_-8de-KTqqtFg_Y9jyuuVii274t8Vvtt69vJHfP-Uaw99GZ6DTLikBnXbJ_wQAAP__d5U2Cg">