mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 05:29:30 +02:00
* inverted the indices of TWasmValueStack, so that item 0 is top of stack
This commit is contained in:
parent
fadf43a33b
commit
6aa49038a5
@ -347,17 +347,23 @@ uses
|
||||
{ TWasmValueStack }
|
||||
|
||||
function TWasmValueStack.GetItems(AIndex: Integer): TWasmBasicType;
|
||||
var
|
||||
I: Integer;
|
||||
begin
|
||||
if (AIndex<Low(FValStack)) or (AIndex>High(FValStack)) then
|
||||
I:=High(FValStack)-AIndex;
|
||||
if (I<Low(FValStack)) or (I>High(FValStack)) then
|
||||
internalerror(2024011702);
|
||||
Result:=FValStack[AIndex];
|
||||
Result:=FValStack[I];
|
||||
end;
|
||||
|
||||
procedure TWasmValueStack.SetItems(AIndex: Integer; AValue: TWasmBasicType);
|
||||
var
|
||||
I: Integer;
|
||||
begin
|
||||
if (AIndex<Low(FValStack)) or (AIndex>High(FValStack)) then
|
||||
I:=High(FValStack)-AIndex;
|
||||
if (I<Low(FValStack)) or (I>High(FValStack)) then
|
||||
internalerror(2024011703);
|
||||
FValStack[AIndex]:=AValue;
|
||||
FValStack[I]:=AValue;
|
||||
end;
|
||||
|
||||
procedure TWasmValueStack.Push(wbt: TWasmBasicType);
|
||||
|
Loading…
Reference in New Issue
Block a user