+ check and generate an internal error if you attempt to take the address of a reference that exists in the local

stack in thlcgwasm.a_loadaddr_ref_reg

git-svn-id: branches/wasm@47942 -
This commit is contained in:
nickysn 2021-01-02 05:44:19 +00:00
parent a1f5b57070
commit ded9afb787

View File

@ -1153,6 +1153,11 @@ implementation
procedure thlcgwasm.a_loadaddr_ref_reg(list: TAsmList; fromsize, tosize: tdef; const ref: treference; r: tregister);
begin
{ you can't take the address of references, that are on the local stack }
if (ref.base=NR_EVAL_STACK_BASE) or (ref.index=NR_EVAL_STACK_BASE) or
(ref.base=NR_LOCAL_STACK_POINTER_REG) or (ref.index=NR_LOCAL_STACK_POINTER_REG) then
internalerror(2021010101);
if assigned(ref.symbol) and (ref.base=NR_NO) and (ref.index=NR_NO) then
begin
// pushing address on stack