Skip to content

Commit 3f553f5

Browse files
committed
Lib: Fix bad MetadataVersion on WasmMemoryBlock
Closes #412
1 parent c0719eb commit 3f553f5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: LibCpp2IL/Wasm/WasmMemoryBlock.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ namespace LibCpp2IL.Wasm;
66
public class WasmMemoryBlock : ClassReadingBinaryReader
77
{
88
internal byte[] Bytes;
9+
private WasmFile _file;
910

10-
public override float MetadataVersion { get; }
11+
//This isn't valid until Init() is called on the parent WasmFile, but that's fine, nothing should be referencing it until then.
12+
public override float MetadataVersion => _file.MetadataVersion;
1113

1214
private static MemoryStream BuildStream(WasmFile file)
1315
{
@@ -34,7 +36,7 @@ private static MemoryStream BuildStream(WasmFile file)
3436

3537
public WasmMemoryBlock(WasmFile file) : base(BuildStream(file))
3638
{
37-
MetadataVersion = file.MetadataVersion;
39+
_file = file;
3840
is32Bit = true;
3941
Bytes = ((MemoryStream)BaseStream).ToArray();
4042
}

0 commit comments

Comments
 (0)