From 8d5374a867e41ae71c271059901277a441898a1f Mon Sep 17 00:00:00 2001 From: Dennis Ranke Date: Thu, 3 Nov 2022 23:27:53 +0100 Subject: [PATCH] add support to ignore empty memory section when packing --- uw8-tool/src/pack.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/uw8-tool/src/pack.rs b/uw8-tool/src/pack.rs index 640bb00..1135a95 100644 --- a/uw8-tool/src/pack.rs +++ b/uw8-tool/src/pack.rs @@ -220,6 +220,11 @@ impl<'a> ParsedModule<'a> { validate_table_section(reader)?; table_section = Some(Section::new(range, ())); } + Payload::MemorySection(reader) => { + if reader.get_count() != 0 { + bail!("Found non-empty MemorySection. Memory has to be imported!"); + } + } Payload::ElementSection(mut reader) => { let mut elements = Vec::with_capacity(reader.get_count() as usize); for _ in 0..reader.get_count() {