|
@@ -49,7 +49,7 @@ interface
|
|
implementation
|
|
implementation
|
|
|
|
|
|
uses
|
|
uses
|
|
- globtype, aasmdata, defutil, tgobj, hlcgcpu, symconst, paramgr;
|
|
|
|
|
|
+ globtype, aasmdata, defutil, tgobj, hlcgcpu, symconst, symcpu;
|
|
|
|
|
|
{ twasmcallnode }
|
|
{ twasmcallnode }
|
|
|
|
|
|
@@ -59,13 +59,20 @@ implementation
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure twasmcallnode.do_release_unused_return_value;
|
|
procedure twasmcallnode.do_release_unused_return_value;
|
|
|
|
+ var
|
|
|
|
+ ft: TWasmFuncType;
|
|
|
|
+ i: Integer;
|
|
begin
|
|
begin
|
|
- if is_void(resultdef) then
|
|
|
|
- exit;
|
|
|
|
- if paramanager.ret_in_param(resultdef,procdefinition) then
|
|
|
|
- exit;
|
|
|
|
- current_asmdata.CurrAsmList.concat(taicpu.op_none(a_drop));
|
|
|
|
- thlcgwasm(hlcg).decstack(current_asmdata.CurrAsmList,1);
|
|
|
|
|
|
+ if procdefinition.typ=procvardef then
|
|
|
|
+ ft:=tcpuprocvardef(procdefinition).create_functype
|
|
|
|
+ else
|
|
|
|
+ ft:=tcpuprocdef(procdefinition).create_functype;
|
|
|
|
+ for i:=1 to Length(ft.results) do
|
|
|
|
+ begin
|
|
|
|
+ current_asmdata.CurrAsmList.concat(taicpu.op_none(a_drop));
|
|
|
|
+ thlcgwasm(hlcg).decstack(current_asmdata.CurrAsmList,1);
|
|
|
|
+ end;
|
|
|
|
+ ft.free;
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure twasmcallnode.set_result_location(realresdef: tstoreddef);
|
|
procedure twasmcallnode.set_result_location(realresdef: tstoreddef);
|