- implemented code generation for stack variables.

- fixed code generation for using local variables as array index. This must use a different register for the array element offset because the original register may not be overwritten.
This commit is contained in:
Christoph Oelckers 2016-11-17 16:44:41 +01:00
commit 2cc48ec378
9 changed files with 306 additions and 92 deletions

View file

@ -182,15 +182,11 @@ void VMScriptFunction::DestroyExtra(void *addr)
}
}
void VMScriptFunction::SetExtraSpecial(PType *type, unsigned offset)
{
type->SetDefaultValue(nullptr, offset, &SpecialInits);
}
int VMScriptFunction::AllocExtraStack(PType *type)
{
int address = ((ExtraSpace + type->Align - 1) / type->Align) * type->Align;
ExtraSpace = address + type->Size;
type->SetDefaultValue(nullptr, address, &SpecialInits);
return address;
}