Browse Source

+ support mapping of structured instructions also in map_structured_asmlist_inner

Nikolay Nikolov 1 year ago
parent
commit
59128241ad
1 changed files with 7 additions and 0 deletions
  1. 7 0
      compiler/wasm32/aasmcpu.pas

+ 7 - 0
compiler/wasm32/aasmcpu.pas

@@ -2856,6 +2856,13 @@ uses
           begin
             if p.typ=ait_wasm_structured_instruction then
               begin
+                q:=f(p,blockstack);
+                if q<>p then
+                  begin
+                    l.InsertAfter(q,p);
+                    l.Remove(p);
+                    p:=q;
+                  end;
                 taicpu_wasm_structured_instruction(p).Map(f,blockstack);
                 p:=tai(p.next);
               end