Browse Source

* set the last=true property of the last tai_local in the locals list in the
beginning of insert_localslist, instead of in the end of prepare_locals

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

+ 5 - 3
compiler/wasm32/cpupi.pas

@@ -670,13 +670,15 @@ implementation
                 l:=l.nextseq;
                 Inc(FFirstFreeLocal);
               end;
-            if assigned(local) then
-              local.last:=true;
           end;
 
         procedure insert_localslist(destlist,localslist: TAsmList);
           begin
-            destlist.insertListAfter(findfirst_tai_functype(destlist),localslist);
+            if assigned(localslist) then
+              begin
+                tai_local(localslist.Last).last:=true;
+                destlist.insertListAfter(findfirst_tai_functype(destlist),localslist);
+              end;
           end;
 
       var