<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/64660>64660</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Constant struct initialization is not checked at module verification
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
mauro-balades
</td>
</tr>
</table>
<pre>
Let's take a look at this code:
```llvm
%"examplety" = type { ptr }
@"example" = internal global %"examplety" { ptr @"example1", ptr @"example2" }
```
This code will be considered as "valid" by the module verifier although it's obviously not. Instead of throwing an error, it will just abort with the following message when emitting an object file with `addPassesToEmitFile`:
```
error: <unknown>:0: invalid number of bytes
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0U91uszgQfRpzM2oE5i9ccNE2jbTSXuxFX2AME5jG2JE9JJt9-hXQqN3u90kIZDzn-JyZY4yRB0fUqvJFlYcEZxl9aCecg38yaLGnmBjf39s_SZSuIwieCRCs92dAARk5Qud7UvmzSg8qfbyrdHusvU6fv3SptKa_cbpYkrvSGlR-ALlfCFT9AhcJoOrDZ3GRfhU_StkJBYcWBusNWvgV44PoOz5TWiv9-v8NvUEOPzR_N_L-MAg3thYMQedd5J4C9YARlNZXtNwvTOYOMhJMvp8twZUCn5gCoJXRz8MIvLXQmyv7Odo7OC87-MNFIezBn0DG4G_sBkAHFIIPi2qW7eiPOQqg8WFZy7gedfLWboiJYsSB4DaSA5pY5JPHmw_qBE5sacOpKsW-_wtjpPju3yaWI1tabP9mhNty05M_g8pfZ3d2_uZU_qby5wUH7NYugJsnQ2HxYu5C8QdT0rd53-QNJtRmVZM1hc7qMhnbfJ_VVZqSPqWl6coCS6SmbvamTKsadZ5wq1Odp_ssz8qyyspdWjddrvfFqSmybK9rVaQ0IdvdEridD0PCMc7UVkVVpYlFQzauKdfa0Q3WzSUW5SEJ7YJ5MvMQVZFajhK_WITFUvvqXRR0AlHC3AmwY2G0_A8Kewccl1FCN1J3XmIh_81At1Ylc7DtKHKJS6P1UenjwDLOZtf5SenjelO2z9Ml-GVqSh9XoVHp42rk3wAAAP__H0MoXw">