Browse Source

* extracted the import preparation to a separate method TWasmExeOutput.PrepareImports

Nikolay Nikolov 1 year ago
parent
commit
f5dbd38b7e
1 changed files with 6 additions and 0 deletions
  1. 6 0
      compiler/ogwasm.pas

+ 6 - 0
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