wasm: Keep exported global variables from the preloaded object file

This commit is contained in:
Brian Carroll 2022-02-14 08:45:18 +00:00
parent b46690ecf2
commit 4c7be277c2
2 changed files with 45 additions and 9 deletions

View file

@ -11,8 +11,6 @@ pub use linking::SymInfo;
use roc_error_macros::internal_error;
pub use sections::{ConstExpr, Export, ExportType, Global, GlobalType, Signature};
use crate::wasm_module::serialize::SkipBytes;
use self::linking::{LinkingSection, RelocationSection};
use self::sections::{
CodeSection, DataSection, ElementSection, ExportSection, FunctionSection, GlobalSection,
@ -146,8 +144,7 @@ impl<'a> WasmModule<'a> {
let global = GlobalSection::preload(arena, bytes, &mut cursor);
ExportSection::skip_bytes(bytes, &mut cursor);
let export = ExportSection::empty(arena);
let export = ExportSection::preload_globals(arena, bytes, &mut cursor);
let start = OpaqueSection::preload(SectionId::Start, arena, bytes, &mut cursor);