Explorar o código

+ introduced taicpu.op_catch

Nikolay Nikolov hai 3 días
pai
achega
621ca7d416
Modificáronse 1 ficheiros con 13 adicións e 0 borrados
  1. 13 0
      compiler/wasm32/aasmcpu.pas

+ 13 - 0
compiler/wasm32/aasmcpu.pas

@@ -145,6 +145,8 @@ uses
       { taicpu }
 
       taicpu = class(tai_cpu_abstract_sym)
+      private type
+        TCatchArray = array of taicpu;
       private
          insoffset : longint;
       public
@@ -169,6 +171,8 @@ uses
 
          constructor op_functype(op : tasmop; _op1: TWasmFuncType);
 
+         constructor op_catch(op : tasmop;_op1 : TCatchArray);
+
          procedure loadfunctype(opidx:longint;ft:TWasmFuncType);
          procedure loadsingle(opidx:longint;f:single);
          procedure loaddouble(opidx:longint;d:double);
@@ -2037,6 +2041,15 @@ uses
        loadfunctype(0,_op1);
       end;
 
+    constructor taicpu.op_catch(op: tasmop; _op1: TCatchArray);
+      var
+        c: taicpu;
+      begin
+        create(op);
+        for c in _op1 do
+          try_table_catch_clauses.Concat(c);
+      end;
+
     procedure taicpu.loadfunctype(opidx: longint; ft: TWasmFuncType);
       begin
        allocate_oper(opidx+1);