Browse Source

* fixed try_table bug in resolve_labels_via_state_machine

Nikolay Nikolov 3 days ago
parent
commit
b2509e2f44
1 changed files with 1 additions and 1 deletions
  1. 1 1
      compiler/wasm32/cpupi.pas

+ 1 - 1
compiler/wasm32/cpupi.pas

@@ -923,7 +923,7 @@ implementation
                         end_block        ;; Count
                         end_block        ;; Count
                       }
                       }
                       for catch_nr:=0 to tai_wasmstruc_try_table(hp).try_table_instr.try_table_catch_clauses.Count do
                       for catch_nr:=0 to tai_wasmstruc_try_table(hp).try_table_instr.try_table_catch_clauses.Count do
-                        curr_block.InsertBefore(hp,taicpu.op_none(a_block));
+                        curr_block.InsertBefore(taicpu.op_none(a_block),hp);
                       tmplist.Clear;
                       tmplist.Clear;
                       tmplist.Concat(taicpu.op_const(a_br,tai_wasmstruc_try_table(hp).try_table_instr.try_table_catch_clauses.Count));
                       tmplist.Concat(taicpu.op_const(a_br,tai_wasmstruc_try_table(hp).try_table_instr.try_table_catch_clauses.Count));
                       catchinstr:=taicpu(tai_wasmstruc_try_table(hp).try_table_instr.try_table_catch_clauses.Last);
                       catchinstr:=taicpu(tai_wasmstruc_try_table(hp).try_table_instr.try_table_catch_clauses.Last);