Browse Source

+ handle wasm funcrefs in tgcpu.defToWasmBasic

Nikolay Nikolov 2 years ago
parent
commit
60cde554fd
1 changed files with 3 additions and 1 deletions
  1. 3 1
      compiler/wasm32/tgcpu.pas

+ 3 - 1
compiler/wasm32/tgcpu.pas

@@ -105,7 +105,9 @@ unit tgcpu;
       if not Result then
         Exit;
 
-      if is_pointer(def) then
+      if (def.typ=procvardef) and (po_wasm_funcref in tprocvardef(def).procoptions) then
+        wbt := wbt_funcref
+      else if is_pointer(def) then
         wbt := wbt_i32 // wasm32
       else if is_currency(def) then
         wbt := wbt_i64