Explorar o código

+ support mapping of structured instructions also in map_structured_asmlist_inner

Nikolay Nikolov %!s(int64=2) %!d(string=hai) anos
pai
achega
084c761c47
Modificáronse 1 ficheiros con 7 adicións e 0 borrados
  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