From f5dbd38b7eea68cdcc714330eba4e7fb28c95f5b Mon Sep 17 00:00:00 2001 From: Nikolay Nikolov Date: Sun, 31 Dec 2023 23:39:26 +0200 Subject: [PATCH] * extracted the import preparation to a separate method TWasmExeOutput.PrepareImports --- compiler/ogwasm.pas | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/compiler/ogwasm.pas b/compiler/ogwasm.pas index b7c8495b27..5410e136f7 100644 --- a/compiler/ogwasm.pas +++ b/compiler/ogwasm.pas @@ -230,6 +230,7 @@ interface FWasmSections: array [TWasmSectionID] of tdynamicarray; procedure WriteWasmSection(wsid: TWasmSectionID); + procedure PrepareImports; protected function writeData:boolean;override; procedure DoRelocationFixup(objsec:TObjSection);override; @@ -4169,6 +4170,11 @@ implementation end; procedure TWasmExeOutput.AfterUnusedSectionRemoval; + begin + PrepareImports; + end; + + procedure TWasmExeOutput.PrepareImports; function AddFunctionImport(const libname,symname:TCmdStr; functype: TWasmFuncType): Integer; begin