* drop unused return values from the stack

git-svn-id: branches/wasm@48036 -
This commit is contained in:
nickysn 2021-01-04 12:44:11 +00:00
parent 0cdd7d4d22
commit f86665b97f

View File

@ -39,6 +39,8 @@ interface
{ twasmcallnode }
twasmcallnode = class(tcgcallnode)
protected
procedure do_release_unused_return_value; override;
procedure set_result_location(realresdef: tstoreddef); override;
end;
@ -50,6 +52,15 @@ implementation
{ twasmcallnode }
procedure twasmcallnode.do_release_unused_return_value;
begin
if is_void(resultdef) then
exit;
current_asmdata.CurrAsmList.concat(taicpu.op_none(a_drop));
// todo: decstack
//thlcgwasm(hlcg).decstack(current_asmdata.CurrAsmList,1);
end;
procedure twasmcallnode.set_result_location(realresdef: tstoreddef);
begin
// default implementation is placing the return value on LOC_REGISTER.