From 8b00598cab3618b66c8b68663750d1fffa4ee85b Mon Sep 17 00:00:00 2001 From: Nikolay Nikolov Date: Wed, 18 Oct 2023 01:52:44 +0300 Subject: [PATCH] * 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 --- compiler/wasm32/cpupi.pas | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/compiler/wasm32/cpupi.pas b/compiler/wasm32/cpupi.pas index f6e50b0ba8..953c9942b8 100644 --- a/compiler/wasm32/cpupi.pas +++ b/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