- pass the current function to the compile context instead of just the containing class.

This commit is contained in:
Christoph Oelckers 2016-10-15 17:40:27 +02:00
commit cbb990a79e
7 changed files with 101 additions and 48 deletions

View file

@ -1888,6 +1888,11 @@ void ZCCCompiler::InitFunctions()
do
{
auto type = DetermineType(c->Type(), f, f->Name, t, false);
if (type->IsKindOf(RUNTIME_CLASS(PStruct)))
{
// structs and classes only get passed by pointer.
type = NewPointer(type);
}
// TBD: disallow certain types? For now, let everything pass that isn't an array.
rets.Push(type);
t = static_cast<decltype(t)>(t->SiblingNext);