diff --git a/compiler/ogwasm.pas b/compiler/ogwasm.pas index 681cbd870e..52d6e3b573 100644 --- a/compiler/ogwasm.pas +++ b/compiler/ogwasm.pas @@ -297,8 +297,10 @@ interface FMaxMemoryPages: Integer; { use for the Name section } FFunctionNameMap: TCustomSectionNameMap; + FGlobalNameMap: TCustomSectionNameMap; procedure AddToNameMap(var nm: TCustomSectionNameMap; aidx: UInt32; const aname: string); procedure AddToFunctionNameMap(aidx: UInt32; const aname: string); + procedure AddToGlobalNameMap(aidx: UInt32; const aname: string); procedure WriteWasmSection(wsid: TWasmSectionID); procedure WriteWasmSectionIfNotEmpty(wsid: TWasmSectionID); procedure WriteWasmCustomSection(wcst: TWasmCustomSectionType); @@ -4791,6 +4793,11 @@ implementation AddToNameMap(FFunctionNameMap,aidx,aname); end; + procedure TWasmExeOutput.AddToGlobalNameMap(aidx: UInt32; const aname: string); + begin + AddToNameMap(FGlobalNameMap,aidx,aname); + end; + procedure TWasmExeOutput.WriteWasmSection(wsid: TWasmSectionID); var b: byte;