mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 01:09:31 +02:00
+ 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:
parent
a1f5b57070
commit
ded9afb787
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user