diff --git a/compiler/ogwasm.pas b/compiler/ogwasm.pas index 671731e7aa..07fbe0414c 100644 --- a/compiler/ogwasm.pas +++ b/compiler/ogwasm.pas @@ -183,7 +183,6 @@ interface FWasmLinkingSubsections: array [low(TWasmLinkingSubsectionType)..high(TWasmLinkingSubsectionType)] of tdynamicarray; procedure WriteWasmSection(wsid: TWasmSectionID); procedure WriteWasmCustomSection(wcst: TWasmCustomSectionType); - procedure CopyDynamicArray(src, dest: tdynamicarray; size: QWord); procedure WriteZeros(dest: tdynamicarray; size: QWord); function IsExternalFunction(sym: TObjSymbol): Boolean; function IsExportedFunction(sym: TWasmObjSymbol): Boolean; @@ -470,6 +469,23 @@ implementation d.write(q,4); end; + procedure CopyDynamicArray(src, dest: tdynamicarray; size: QWord); + var + buf: array [0..4095] of byte; + bs: Integer; + begin + while size>0 do + begin + if size0 do - begin - if size