Browse Source

+ add the extra allocated locals before inserting the locals list in wasm32 tcpuprocinfo.postprocess_code

Nikolay Nikolov 1 year ago
parent
commit
fc9719f5f9
1 changed files with 9 additions and 0 deletions
  1. 9 0
      compiler/wasm32/cpupi.pas

+ 9 - 0
compiler/wasm32/cpupi.pas

@@ -713,6 +713,14 @@ implementation
               end;
               end;
           end;
           end;
 
 
+        procedure add_extra_allocated_locals(localslist: TAsmList);
+          var
+            t: TWasmBasicType;
+          begin
+            for t in FAllocatedLocals do
+              localslist.Concat(tai_local.create(t));
+          end;
+
         procedure insert_localslist(destlist,localslist: TAsmList);
         procedure insert_localslist(destlist,localslist: TAsmList);
           begin
           begin
             if assigned(localslist) then
             if assigned(localslist) then
@@ -736,6 +744,7 @@ implementation
 {$endif DEBUG_WASM_GOTO}
 {$endif DEBUG_WASM_GOTO}
           resolve_labels_complex(aktproccode);
           resolve_labels_complex(aktproccode);
 
 
+        add_extra_allocated_locals(localslist);
         insert_localslist(aktproccode,localslist);
         insert_localslist(aktproccode,localslist);
         localslist.Free;
         localslist.Free;