mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 21:10:01 +02:00
+ adjust the stack properly on function calls
git-svn-id: branches/wasm@48037 -
This commit is contained in:
parent
f86665b97f
commit
0a0ec1de65
@ -40,6 +40,7 @@ interface
|
|||||||
|
|
||||||
twasmcallnode = class(tcgcallnode)
|
twasmcallnode = class(tcgcallnode)
|
||||||
protected
|
protected
|
||||||
|
procedure extra_post_call_code; override;
|
||||||
procedure do_release_unused_return_value; override;
|
procedure do_release_unused_return_value; override;
|
||||||
procedure set_result_location(realresdef: tstoreddef); override;
|
procedure set_result_location(realresdef: tstoreddef); override;
|
||||||
end;
|
end;
|
||||||
@ -52,13 +53,17 @@ implementation
|
|||||||
|
|
||||||
{ twasmcallnode }
|
{ twasmcallnode }
|
||||||
|
|
||||||
|
procedure twasmcallnode.extra_post_call_code;
|
||||||
|
begin
|
||||||
|
thlcgwasm(hlcg).g_adjust_stack_after_call(current_asmdata.CurrAsmList,procdefinition,pushedparasize,typedef);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure twasmcallnode.do_release_unused_return_value;
|
procedure twasmcallnode.do_release_unused_return_value;
|
||||||
begin
|
begin
|
||||||
if is_void(resultdef) then
|
if is_void(resultdef) then
|
||||||
exit;
|
exit;
|
||||||
current_asmdata.CurrAsmList.concat(taicpu.op_none(a_drop));
|
current_asmdata.CurrAsmList.concat(taicpu.op_none(a_drop));
|
||||||
// todo: decstack
|
thlcgwasm(hlcg).decstack(current_asmdata.CurrAsmList,1);
|
||||||
//thlcgwasm(hlcg).decstack(current_asmdata.CurrAsmList,1);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure twasmcallnode.set_result_location(realresdef: tstoreddef);
|
procedure twasmcallnode.set_result_location(realresdef: tstoreddef);
|
||||||
|
Loading…
Reference in New Issue
Block a user