- fixed: 'out' parameters must always allocate an address register, regardless of type.

This commit is contained in:
Christoph Oelckers 2017-01-03 16:00:25 +01:00
parent 96623b3052
commit 341d9abdd0

View file

@ -864,7 +864,8 @@ void FFunctionBuildList::Build()
auto flags = item.Func->Variants[0].ArgFlags[i];
// this won't get resolved and won't get emitted. It is only needed so that the code generator can retrieve the necessary info about this argument to do its work.
auto local = new FxLocalVariableDeclaration(type, name, nullptr, flags, FScriptPosition());
local->RegNum = buildit.Registers[type->GetRegType()].Get(type->GetRegCount());
if (!(flags & VARF_Out)) local->RegNum = buildit.Registers[type->GetRegType()].Get(type->GetRegCount());
else local->RegNum = buildit.Registers[REGT_POINTER].Get(1);
ctx.FunctionArgs.Push(local);
}