[PATCH 48/83] updating getting of an address for symbols

From 9c484ef5a3c0f277b80c27b067aa9b963c2c8b5d Mon Sep 17 00:00:00 2001
From: Dmitry Boyarintsev <skalogryz.lists@gmail.com>
Date: Thu, 19 Sep 2019 23:35:56 -0400

git-svn-id: branches/wasm@45925 -
This commit is contained in:
nickysn 2020-07-29 17:58:17 +00:00
parent 550bd07a6a
commit 8ad77296b2

View File

@ -1134,7 +1134,15 @@ implementation
return that pointer) }
if not wasmimplicitpointertype(fromsize) then
internalerror(2010120534);
a_load_ref_reg(list,ptruinttype,ptruinttype,ref,r);
if assigned(ref.symbol) then begin
// pushing address on stack
list.Concat(taicpu.op_ref(a_get_global, ref));
incstack(list, 1);
// reading back to the register
a_load_stack_reg(list, tosize, r);
end else
a_load_ref_reg(list,ptruinttype,ptruinttype,ref,r);
end;
procedure thlcgwasm.a_op_const_reg(list: TAsmList; Op: TOpCG; size: tdef; a: tcgint; reg: TRegister);