- backend update from Raze.

* add QualifiedName to VMFunction and allocate these static names from the class data memory arena instead of using FStrings.
* null pointer type checks in the VM added to avoid crash on bad codegen.
This commit is contained in:
Christoph Oelckers 2023-07-22 09:55:49 +02:00
commit 81fb9a26b2
25 changed files with 78 additions and 44 deletions

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->QualifiedName = it.Function->PrintableName = ClassDataAllocator.Strdup(name);
it.Function->ImplicitArgs = functype->GetImplicitArgs();
it.Proto = nullptr;
it.FromDecorate = fromdecorate;
@ -866,7 +866,7 @@ void FFunctionBuildList::Build()
item.Proto = ctx.ReturnProto;
if (item.Proto == nullptr)
{
item.Code->ScriptPosition.Message(MSG_ERROR, "Function %s without prototype", item.PrintableName.GetChars());
item.Code->ScriptPosition.Message(MSG_ERROR, "Function %s without prototype", item.PrintableName);
continue;
}
@ -913,7 +913,7 @@ void FFunctionBuildList::Build()
catch (CRecoverableError &err)
{
// catch errors from the code generator and pring something meaningful.
item.Code->ScriptPosition.Message(MSG_ERROR, "%s in %s", err.GetMessage(), item.PrintableName.GetChars());
item.Code->ScriptPosition.Message(MSG_ERROR, "%s in %s", err.GetMessage(), item.PrintableName);
}
}
delete item.Code;