mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-11 07:11:54 +00:00
Forbade dynamic array as the return type of a function
Compiler ignored this case silently but it crashed during code generation
This commit is contained in:
parent
5df5e2abe7
commit
ac7e5def32
1 changed files with 5 additions and 0 deletions
|
@ -2316,6 +2316,11 @@ void ZCCCompiler::CompileFunction(ZCC_StructWork *c, ZCC_FuncDeclarator *f, bool
|
||||||
// structs and classes only get passed by pointer.
|
// structs and classes only get passed by pointer.
|
||||||
type = NewPointer(type);
|
type = NewPointer(type);
|
||||||
}
|
}
|
||||||
|
else if (type->isDynArray())
|
||||||
|
{
|
||||||
|
Error(f, "The return type of a function cannot be a dynamic array");
|
||||||
|
break;
|
||||||
|
}
|
||||||
// TBD: disallow certain types? For now, let everything pass that isn't an array.
|
// TBD: disallow certain types? For now, let everything pass that isn't an array.
|
||||||
rets.Push(type);
|
rets.Push(type);
|
||||||
t = static_cast<decltype(t)>(t->SiblingNext);
|
t = static_cast<decltype(t)>(t->SiblingNext);
|
||||||
|
|
Loading…
Reference in a new issue