- allocate VMFunction's PrintableName from the ClassDataAllocator arena.

This avoids execution order issues on shutdown. VMFunction should not use FString.
This commit is contained in:
Christoph Oelckers 2023-05-23 23:01:17 +02:00
parent 7d30f1921c
commit 213bdbadad
15 changed files with 28 additions and 20 deletions

View file

@ -9151,7 +9151,7 @@ FxExpression *FxVMFunctionCall::Resolve(FCompileContext& ctx)
// [Player701] Catch attempts to call abstract functions directly at compile time
if (NoVirtual && Function->Variants[0].Implementation->VarFlags & VARF_Abstract)
{
ScriptPosition.Message(MSG_ERROR, "Cannot call abstract function %s", Function->Variants[0].Implementation->PrintableName.GetChars());
ScriptPosition.Message(MSG_ERROR, "Cannot call abstract function %s", Function->Variants[0].Implementation->PrintableName);
delete this;
return nullptr;
}

View file

@ -790,7 +790,7 @@ VMFunction *FFunctionBuildList::AddFunction(PNamespace *gnspc, const VersionInfo
it.PrintableName = name;
it.Function = new VMScriptFunction;
it.Function->Name = functype->SymbolName;
it.Function->PrintableName = name;
it.Function->PrintableName = ClassDataAllocator.Strdup(name);
it.Function->ImplicitArgs = functype->GetImplicitArgs();
it.Proto = nullptr;
it.FromDecorate = fromdecorate;