Make sure maps in return type don't segfault

This commit is contained in:
Ricardo Luís Vaz Silva 2023-02-23 13:31:30 -03:00 committed by Christoph Oelckers
parent 3fc195c5b2
commit fad350ff80

View file

@ -2254,6 +2254,11 @@ void ZCCCompiler::CompileFunction(ZCC_StructWork *c, ZCC_FuncDeclarator *f, bool
Error(f, "The return type of a function cannot be a dynamic array");
break;
}
else if (type->isMap())
{
Error(f, "The return type of a function cannot be a map");
break;
}
else if (type == TypeFVector2)
{
type = TypeVector2;