Browse Source

* fixed another WebAssembly compilation error with -CR

git-svn-id: trunk@48966 -
nickysn 4 years ago
parent
commit
f0aed5d355
1 changed files with 4 additions and 1 deletions
  1. 4 1
      compiler/wasm32/hlcgcpu.pas

+ 4 - 1
compiler/wasm32/hlcgcpu.pas

@@ -1832,7 +1832,10 @@ implementation
       realresdef: tdef;
       ft: TWasmFuncType;
     begin
-      ft:=tcpuprocdef(pd).create_functype;
+      if pd.typ=procvardef then
+        ft:=tcpuprocvardef(pd).create_functype
+      else
+        ft:=tcpuprocdef(pd).create_functype;
       totalremovesize:=Length(ft.params)-Length(ft.results);
       if (Length(ft.results)=0) and (po_discardresult in pd.procoptions) then
         dec(totalremovesize);