Browse Source

* WebAssembly: fixed crash when attempting to generate a functype directive for
a generic function

Nikolay Nikolov 11 months ago
parent
commit
54d65ff75c
1 changed files with 2 additions and 1 deletions
  1. 2 1
      compiler/wasm32/hlcgcpu.pas

+ 2 - 1
compiler/wasm32/hlcgcpu.pas

@@ -2459,7 +2459,8 @@ implementation
 
 
   procedure thlcgwasm.g_procdef(list: TAsmList; pd: tprocdef);
   procedure thlcgwasm.g_procdef(list: TAsmList; pd: tprocdef);
     begin
     begin
-      list.Concat(tai_functype.create(pd.mangledname,tcpuprocdef(pd).create_functype));
+      if not pd.is_generic then
+        list.Concat(tai_functype.create(pd.mangledname,tcpuprocdef(pd).create_functype));
     end;
     end;
 
 
   procedure thlcgwasm.g_maybe_checkforexceptions(list: TasmList);
   procedure thlcgwasm.g_maybe_checkforexceptions(list: TasmList);