Browse Source

+ introduced TWasmValidationStacks.label_types

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

+ 10 - 0
compiler/wasm32/aasmcpu.pas

@@ -101,6 +101,8 @@ uses
 
         procedure PushCtrl(_opcode: tasmop; _in, _out: TWasmBasicTypeList);
         function PopCtrl: TWasmControlFrame;
+
+        function label_types(const frame: TWasmControlFrame): TWasmBasicTypeList;
       end;
 
       twasmstruc_stack = class;
@@ -531,6 +533,14 @@ uses
         FCtrlStack.Pop;
       end;
 
+    function TWasmValidationStacks.label_types(const frame: TWasmControlFrame): TWasmBasicTypeList;
+      begin
+        if frame.opcode=a_loop then
+          Result:=frame.start_types
+        else
+          Result:=frame.end_types;
+      end;
+
     { twasmstruc_stack }
 
     function twasmstruc_stack.Get(Index: Integer): taicpu_wasm_structured_instruction;