mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-12-02 00:43:29 +00:00
Really fixed arrays of dynarrays this time.
This commit is contained in:
parent
08cda06a11
commit
4161ef7646
1 changed files with 5 additions and 6 deletions
|
@ -7424,7 +7424,6 @@ ExpEmit FxArrayElement::Emit(VMFunctionBuilder *build)
|
||||||
{
|
{
|
||||||
bool ismeta = Array->ExprType == EFX_ClassMember && static_cast<FxClassMember*>(Array)->membervar->Flags & VARF_Meta;
|
bool ismeta = Array->ExprType == EFX_ClassMember && static_cast<FxClassMember*>(Array)->membervar->Flags & VARF_Meta;
|
||||||
|
|
||||||
arrayvar.Free(build);
|
|
||||||
start = ExpEmit(build, REGT_POINTER);
|
start = ExpEmit(build, REGT_POINTER);
|
||||||
build->Emit(OP_LP, start.RegNum, arrayvar.RegNum, build->GetConstantInt(0));
|
build->Emit(OP_LP, start.RegNum, arrayvar.RegNum, build->GetConstantInt(0));
|
||||||
|
|
||||||
|
@ -7444,18 +7443,18 @@ ExpEmit FxArrayElement::Emit(VMFunctionBuilder *build)
|
||||||
arraymemberbase->membervar = origmembervar;
|
arraymemberbase->membervar = origmembervar;
|
||||||
arraymemberbase->AddressRequested = origaddrreq;
|
arraymemberbase->AddressRequested = origaddrreq;
|
||||||
Array->ValueType = origvaluetype;
|
Array->ValueType = origvaluetype;
|
||||||
|
|
||||||
|
arrayvar.Free(build);
|
||||||
}
|
}
|
||||||
else if (Array->ExprType == EFX_ArrayElement && Array->isStaticArray())
|
else if (Array->ExprType == EFX_ArrayElement && Array->isStaticArray())
|
||||||
{
|
{
|
||||||
bool ismeta = Array->ExprType == EFX_ClassMember && static_cast<FxClassMember*>(Array)->membervar->Flags & VARF_Meta;
|
bound = ExpEmit(build, REGT_INT);
|
||||||
|
build->Emit(OP_LW, bound.RegNum, arrayvar.RegNum, build->GetConstantInt(myoffsetof(FArray, Count)));
|
||||||
|
|
||||||
arrayvar.Free(build);
|
arrayvar.Free(build);
|
||||||
start = ExpEmit(build, REGT_POINTER);
|
start = ExpEmit(build, REGT_POINTER);
|
||||||
build->Emit(OP_LP, start.RegNum, arrayvar.RegNum, build->GetConstantInt(0));
|
build->Emit(OP_LP, start.RegNum, arrayvar.RegNum, build->GetConstantInt(0));
|
||||||
|
|
||||||
bound = ExpEmit(build, REGT_INT);
|
|
||||||
build->Emit(OP_LW, bound.RegNum, arrayvar.RegNum, build->GetConstantInt(sizeof(void*)));
|
|
||||||
|
|
||||||
nestedarray = true;
|
nestedarray = true;
|
||||||
}
|
}
|
||||||
else start = arrayvar;
|
else start = arrayvar;
|
||||||
|
@ -7513,7 +7512,7 @@ ExpEmit FxArrayElement::Emit(VMFunctionBuilder *build)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ExpEmit indexv(index->Emit(build));
|
ExpEmit indexv(index->Emit(build));
|
||||||
if (SizeAddr != ~0u)
|
if (SizeAddr != ~0u || nestedarray)
|
||||||
{
|
{
|
||||||
build->Emit(OP_BOUND_R, indexv.RegNum, bound.RegNum);
|
build->Emit(OP_BOUND_R, indexv.RegNum, bound.RegNum);
|
||||||
bound.Free(build);
|
bound.Free(build);
|
||||||
|
|
Loading…
Reference in a new issue