Skip to content

Commit

Permalink
Try #1320:
Browse files Browse the repository at this point in the history
  • Loading branch information
bors[bot] authored Mar 20, 2020
2 parents 04754aa + 248e061 commit 8a8a6ae
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/runtime-core/src/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ pub struct ModuleInfo {
pub em_symbol_map: Option<HashMap<u32, String>>,

/// Custom sections.
pub custom_sections: HashMap<String, Vec<u8>>,
pub custom_sections: HashMap<String, Vec<Vec<u8>>>,

/// Flag controlling whether or not debug information for use in a debugger
/// will be generated.
Expand All @@ -102,7 +102,8 @@ impl ModuleInfo {
let bytes = reader.read_bytes(len)?;
let data = bytes.to_vec();
let name = name.to_string();
self.custom_sections.insert(name, data);
let entry: &mut Vec<Vec<u8>> = self.custom_sections.entry(name).or_default();
entry.push(data);
}
}
Ok(())
Expand Down

0 comments on commit 8a8a6ae

Please sign in to comment.