Selaa lähdekoodia

Fixed comptime malloc/free with custom allocator set

Brian Fiete 3 vuotta sitten
vanhempi
commit
dcd6f229af
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2 2
      IDEHelper/Compiler/BfModule.cpp

+ 2 - 2
IDEHelper/Compiler/BfModule.cpp

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