<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/76662>76662</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Problem with SDL option in visual studio project
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Panadulek
</td>
</tr>
</table>
<pre>
When i have turn on SDL option then come assertion failure (_CrtlsValidHeapPointer(block)) on clearing Function List. But when i turn off SDL option in project everything is OK.
Sample which give me error
```
llvm::LLVMContext context;
llvm::IRBuilder<> builder(context);
llvm::Module* module = new llvm::Module("testModule", context);
llvm::FunctionType* funcType = llvm::FunctionType::get(builder.getInt32Ty(), false);
llvm::Function* function = llvm::Function::Create(funcType, llvm::Function::ExternalLinkage, "testFunction", module);
llvm::BasicBlock* basicBlock = llvm::BasicBlock::Create(context, "entry", function);
builder.SetInsertPoint(basicBlock);
llvm::AllocaInst* localVariable = builder.CreateAlloca(builder.getInt32Ty(), nullptr, "localVar");
builder.CreateRet(llvm::ConstantInt::get(context, llvm::APInt(32, 0)));
module->print(llvm::outs(), nullptr);
delete module; // <-- assertion failed happens
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyEVF1vqzgQ_TXmxUpE7HzAAw_5aLTV5mqr26vu48rAAN4aG9lDevPvVzbQptlUlaJgw8w5Z87YI5yTtQbIyGpHVodI9NgYmz0JLcpewWuUm_KS_d2AppI24gwUe6up0fT5cKKmQ2k0Rf-5MC1Q4RzY8K4SUvUWKGHJP3uLyr0IJcs_QHRPRmoES1iSK1O8EpYSlnrEQoGwUtf02OsigJykwznd9UjfBgUDeVVds0tNO2v-hQIpnMFesPEY0tG__pyT-EDi7fD_LNpOAX1rZNHQWp6BtkDBWmPHqHU8_sakVKlzS_iW8O3p9PJjbzTCb6TF8CR8dyfw8eeul6oES_ie8AeajzuWTGksvZ_5w3jDCdvSNqwo4Qeq4Y3-PyQhjCE4nPaMsD39Dn8y9delCyxVrwu_DjxfhIU3NaDv1VDIvAZ81MjZr0vQkXrqSigH3xJPpKFp90mH3d6CQF_mJNFzfBX88BvBaqFOUr-KOoSO7nzwBn_a0awvVO6Ek8VuOJBbmr_vbpRehX3W-m5_4AeN9jISV-86PlFPhj57Q_2tCffCO32l5AuxW6VMIR61Qy_Wr9WLsFLk47GZsAd1Q_Q3PdS9Uh3aUf8EGUq4K3uA_hnOxoewvdEOhfbw14fnypyrIp4eQ708uBQPc-CGbWjajPCHzg7ufOSbHt0d_Z_yS1CAMPWe7yhhR8KOlPD9bHYzraCkjeg60O5mHkRlxsuUpyKCbLGJlzHfcMajJmOrXJRpWq03wMu4LKo4EeUiXiyLJN8wxiKZsZjxBeOLxWrJYj6vxGoj1nGZJKuqWnFGljG0Qqq5L2tubB1J53rINuv1mkVK5KBcGM2M-VEQPvqerA6RzXzOLO9rR5axkg7dBwpKVJA9WZMraOmbxOZmYp6l64WiDvtSmml-Rr1VWYPYOe9wcKqW2PT5vDAtYcfg_fCYjSmEHYMoR9gxiP4vAAD__6tu-Sg">