diff --git a/compiler/ogwasm.pas b/compiler/ogwasm.pas index c674cd78d8..70d60d047c 100644 --- a/compiler/ogwasm.pas +++ b/compiler/ogwasm.pas @@ -5174,8 +5174,11 @@ implementation WriteNameMap(FDataNameMap,FWasmNameSubsections[wnstDataNames]); WriteNameSubsection(wnstDataNames); - WriteNameMap(FTagNameMap,FWasmNameSubsections[wnstTagNames]); - WriteNameSubsection(wnstTagNames); + if Length(FTagNameMap)>0 then + begin + WriteNameMap(FTagNameMap,FWasmNameSubsections[wnstTagNames]); + WriteNameSubsection(wnstTagNames); + end; end; var