[PATCH 33/83] do the proper preparation for memory (ref) access

From a3f4e2440270248a15475566596c1be8dff32854 Mon Sep 17 00:00:00 2001
From: Dmitry Boyarintsev <skalogryz.lists@gmail.com>
Date: Mon, 16 Sep 2019 09:14:21 -0400

git-svn-id: branches/wasm@45910 -
This commit is contained in:
nickysn 2020-07-29 17:17:37 +00:00
parent fe7826a013
commit 7e96f42210

View File

@ -999,6 +999,10 @@ implementation
{ fake location that indicates the value is already on the stack? }
if (ref.base=NR_EVAL_STACK_BASE) then
exit;
// setting up memory offset
list.Concat(taicpu.op_const(a_i32_const, 0)); //todo: this should not be 0, this should be reference to a global "memory"
{ non-array accesses cannot have an index reg }
if ref.index<>NR_NO then
internalerror(2010120509);
@ -1926,8 +1930,6 @@ implementation
if ref.base=NR_EVAL_STACK_BASE then
exit;
opc:=loadstoreopcref(size,false,ref,finishandval);
if opc in AsmOp_LoadStore then
list.Concat(taicpu.op_const(a_i32_const, 0)); //todo: this should not be 0, this should be reference to a global "memory"
list.concat(taicpu.op_ref(opc,ref));
{ avoid problems with getting the size of an open array etc }
@ -1961,9 +1963,6 @@ implementation
exit;
opc:=loadstoreopcref(size,true,ref,finishandval);
if opc in AsmOp_LoadStore then
list.Concat(taicpu.op_const(a_i32_const, 0)); //todo: this should not be 0, this should be reference to a global "memory"
list.concat(taicpu.op_ref(opc,ref));
{ avoid problems with getting the size of an open array etc }