Browse Source

* fixed the stack tracking in twasmcallnode.do_release_unused_return_value for
ret_in_param function calls

Nikolay Nikolov 3 years ago
parent
commit
fa36141649
1 changed files with 3 additions and 1 deletions
  1. 3 1
      compiler/wasm32/nwasmcal.pas

+ 3 - 1
compiler/wasm32/nwasmcal.pas

@@ -49,7 +49,7 @@ interface
 implementation
 implementation
 
 
     uses
     uses
-      globtype, aasmdata, defutil, tgobj, hlcgcpu, symconst;
+      globtype, aasmdata, defutil, tgobj, hlcgcpu, symconst, paramgr;
 
 
       { twasmcallnode }
       { twasmcallnode }
 
 
@@ -62,6 +62,8 @@ implementation
       begin
       begin
         if is_void(resultdef) then
         if is_void(resultdef) then
           exit;
           exit;
+        if paramanager.ret_in_param(resultdef,procdefinition) then
+          exit;
         current_asmdata.CurrAsmList.concat(taicpu.op_none(a_drop));
         current_asmdata.CurrAsmList.concat(taicpu.op_none(a_drop));
         thlcgwasm(hlcg).decstack(current_asmdata.CurrAsmList,1);
         thlcgwasm(hlcg).decstack(current_asmdata.CurrAsmList,1);
       end;
       end;