Browse Source

* insert the wasm locals asm list after resolve_labels_complex, since it will (in the future) be able to allocate more locals, in order to resolve the branches and goto

Nikolay Nikolov 1 year ago
parent
commit
5b64e5b957
1 changed files with 3 additions and 2 deletions
  1. 3 2
      compiler/wasm32/cpupi.pas

+ 3 - 2
compiler/wasm32/cpupi.pas

@@ -684,8 +684,6 @@ implementation
         labels_resolved: Boolean;
       begin
         localslist:=prepare_locals;
-        insert_localslist(aktproccode,localslist);
-        localslist.Free;
 
         replace_local_frame_pointer(aktproccode);
 
@@ -695,6 +693,9 @@ implementation
 {$endif DEBUG_WASM_GOTO}
           resolve_labels_complex(aktproccode);
 
+        insert_localslist(aktproccode,localslist);
+        localslist.Free;
+
         inherited postprocess_code;
       end;