1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

Fixed comptime malloc/free with custom allocator set

This commit is contained in:
Brian Fiete 2022-06-02 07:06:55 -07:00
parent 7e94abe43a
commit dcd6f229af

View file

@ -7688,7 +7688,7 @@ BfIRFunction BfModule::GetBuiltInFunc(BfBuiltInFuncType funcTypeId)
else
{
String funcName = mCompiler->mOptions.mMallocLinkName;
if (funcName.IsEmpty())
if ((funcName.IsEmpty()) || (mIsComptimeModule))
funcName = "malloc";
func = mBfIRBuilder->GetFunction(funcName);
if (!func)
@ -7711,7 +7711,7 @@ BfIRFunction BfModule::GetBuiltInFunc(BfBuiltInFuncType funcTypeId)
else
{
String funcName = mCompiler->mOptions.mFreeLinkName;
if (funcName.IsEmpty())
if ((funcName.IsEmpty()) || (mIsComptimeModule))
funcName = "free";
func = mBfIRBuilder->GetFunction(funcName);
if (!func)