Skip to content

Commit 7f106ea

Browse files
committed
Added support for DataCount section in module loading
1 parent d434bf0 commit 7f106ea

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

WebAssembly/Module.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,12 @@ public static Module ReadFromBinary(Stream input)
348348
}
349349
break;
350350

351+
case Section.DataCount: //Optional section, indicates the expected length of the data segment vector
352+
{
353+
reader.ReadUInt32();
354+
}
355+
break;
356+
351357
default:
352358
throw new ModuleLoadException($"Unrecognized section type {id}.", preSectionOffset);
353359
}

WebAssembly/Section.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ public enum Section : byte
5252
/// <summary>
5353
/// Data segments.
5454
/// </summary>
55-
Data
55+
Data,
56+
/// <summary>
57+
/// Optional segment which indicates the number of sata segments
58+
/// </summary>
59+
DataCount,
5660
}
5761

5862
static class SectionExtensions

0 commit comments

Comments
 (0)