Quellcode durchsuchen

Fixed comptime malloc/free with custom allocator set

Brian Fiete vor 3 Jahren
Ursprung
Commit
dcd6f229af
1 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 2 2
      IDEHelper/Compiler/BfModule.cpp

+ 2 - 2
IDEHelper/Compiler/BfModule.cpp

@@ -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)