mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-22 11:49:17 +02:00
* wasm base and index reference access fixes
git-svn-id: branches/wasm@47177 -
This commit is contained in:
parent
d15e9717e3
commit
64b2d8ef85
@ -197,7 +197,7 @@ implementation
|
|||||||
begin
|
begin
|
||||||
// local symbol -> stack slot, stored in offset
|
// local symbol -> stack slot, stored in offset
|
||||||
result:='';
|
result:='';
|
||||||
if ref.base<>NR_STACK_POINTER_REG then
|
if (ref.base<>NR_STACK_POINTER_REG) and (ref.base<>NR_NO) then
|
||||||
result:=std_regname(ref.base);
|
result:=std_regname(ref.base);
|
||||||
if ref.index<>NR_NO then
|
if ref.index<>NR_NO then
|
||||||
if result<>'' then
|
if result<>'' then
|
||||||
|
@ -1044,14 +1044,16 @@ implementation
|
|||||||
if (ref.base=NR_EVAL_STACK_BASE) or (ref.islocal) then
|
if (ref.base=NR_EVAL_STACK_BASE) or (ref.islocal) then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
// setting up memory offset
|
|
||||||
if assigned(ref.symbol) then
|
if assigned(ref.symbol) then
|
||||||
|
begin
|
||||||
|
Writeln(ref.symbol.name, ' ', std_Regname(ref.base), ' ', std_regname(ref.index));
|
||||||
|
end;
|
||||||
|
// setting up memory offset
|
||||||
|
if assigned(ref.symbol) and (ref.base=NR_NO) and (ref.index=NR_NO) then
|
||||||
begin
|
begin
|
||||||
list.Concat(taicpu.op_const(a_i32_const,0));
|
list.Concat(taicpu.op_const(a_i32_const,0));
|
||||||
incstack(list,1);
|
incstack(list,1);
|
||||||
result:=1;
|
result:=1;
|
||||||
if (ref.base<>NR_NO) or (ref.index<>NR_NO) then
|
|
||||||
internalerror(2020102401);
|
|
||||||
end
|
end
|
||||||
else if ref.index <> NR_NO then // array access
|
else if ref.index <> NR_NO then // array access
|
||||||
begin
|
begin
|
||||||
@ -1059,6 +1061,10 @@ implementation
|
|||||||
list.Concat(taicpu.op_reg(a_get_local, ref.base));
|
list.Concat(taicpu.op_reg(a_get_local, ref.base));
|
||||||
list.Concat(taicpu.op_reg(a_get_local, ref.index));
|
list.Concat(taicpu.op_reg(a_get_local, ref.index));
|
||||||
list.Concat(taicpu.op_none(a_i32_add));
|
list.Concat(taicpu.op_none(a_i32_add));
|
||||||
|
ref.base:=NR_NO;
|
||||||
|
ref.index:=NR_NO;
|
||||||
|
incstack(list,1);
|
||||||
|
result:=1;
|
||||||
end
|
end
|
||||||
else if (ref.base<>NR_NO) then
|
else if (ref.base<>NR_NO) then
|
||||||
begin
|
begin
|
||||||
@ -1075,6 +1081,7 @@ implementation
|
|||||||
end;
|
end;
|
||||||
{ field name/type encoded in symbol, no index/offset }
|
{ field name/type encoded in symbol, no index/offset }
|
||||||
result:=1;
|
result:=1;
|
||||||
|
ref.base:=NR_NO;
|
||||||
end
|
end
|
||||||
else // if (ref.base = NR_FRAME_POINTER_REG) then
|
else // if (ref.base = NR_FRAME_POINTER_REG) then
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user