Browse Source

+ support a_call_indirect in TWasmValidationStacks.Validate

Nikolay Nikolov 1 year ago
parent
commit
2dcb15f88f
1 changed files with 10 additions and 0 deletions
  1. 10 0
      compiler/wasm32/aasmcpu.pas

+ 10 - 0
compiler/wasm32/aasmcpu.pas

@@ -973,6 +973,16 @@ uses
               PopVal(FGetLocalType(GetLocalIndex));
               PushVal(FGetLocalType(GetLocalIndex));
             end;
+          a_call_indirect:
+            begin
+              if a.ops<>1 then
+                internalerror(2024022401);
+              if a.oper[0]^.typ<>top_functype then
+                internalerror(2024022402);
+              PopVal(wbt_i32);
+              PopVals(a.oper[0]^.functype.params);
+              PushVals(a.oper[0]^.functype.results);
+            end;
           else
             internalerror(2024030502);
         end;