Parcourir la source

+ introduced method TWasmExeOutput.AddToNameMap

Nikolay Nikolov il y a 10 mois
Parent
commit
7c545cfa8b
1 fichiers modifiés avec 9 ajouts et 3 suppressions
  1. 9 3
      compiler/ogwasm.pas

+ 9 - 3
compiler/ogwasm.pas

@@ -297,6 +297,7 @@ interface
         FMaxMemoryPages: Integer;
         { use for the Name section }
         FFunctionNameMap: TCustomSectionNameMap;
+        procedure AddToNameMap(var nm: TCustomSectionNameMap; aidx: UInt32; const aname: string);
         procedure AddToFunctionNameMap(aidx: UInt32; const aname: string);
         procedure WriteWasmSection(wsid: TWasmSectionID);
         procedure WriteWasmSectionIfNotEmpty(wsid: TWasmSectionID);
@@ -4775,16 +4776,21 @@ implementation
                                TWasmExeOutput
 ****************************************************************************}
 
-    procedure TWasmExeOutput.AddToFunctionNameMap(aidx: UInt32; const aname: string);
+    procedure TWasmExeOutput.AddToNameMap(var nm: TCustomSectionNameMap; aidx: UInt32; const aname: string);
       begin
-        SetLength(FFunctionNameMap,Length(FFunctionNameMap)+1);
-        with FFunctionNameMap[High(FFunctionNameMap)] do
+        SetLength(nm,Length(nm)+1);
+        with nm[High(nm)] do
           begin
             idx:=aidx;
             name:=aname;
           end;
       end;
 
+    procedure TWasmExeOutput.AddToFunctionNameMap(aidx: UInt32; const aname: string);
+      begin
+        AddToNameMap(FFunctionNameMap,aidx,aname);
+      end;
+
     procedure TWasmExeOutput.WriteWasmSection(wsid: TWasmSectionID);
       var
         b: byte;