Skip to content

Commit f480765

Browse files
committed
Upgrade wasmparser version
1 parent 79f81a6 commit f480765

File tree

3 files changed

+46
-46
lines changed

3 files changed

+46
-46
lines changed

Cargo.lock

Lines changed: 39 additions & 39 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ edition = "2018"
77
[dependencies]
88
llvm-alt = { git = "https://github.com/Others/llvm-rs.git"}
99
structopt = "0.2"
10-
wasmparser = "0.22"
10+
wasmparser = "0.26"
1111

1212
[profile.release]
1313
debug = true

src/wasm.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,7 @@ impl WasmModule {
844844
SectionCode::Element => ProcessState::TableElementSection,
845845
SectionCode::Global => ProcessState::GlobalSection,
846846
SectionCode::Custom { name, kind } => ProcessState::CustomSection {
847-
name: name.to_vec(),
847+
name: Vec::from(name.as_bytes()),
848848
kind,
849849
},
850850
e => panic!("Have not implemented section code {:?}", e),
@@ -900,8 +900,8 @@ impl WasmModule {
900900
} => {
901901
match ty {
902902
ImportSectionEntryType::Function(i) => {
903-
let source = str::from_utf8(module).unwrap().to_string();
904-
let name = str::from_utf8(field).unwrap().to_string();
903+
let source = module.to_string();
904+
let name = field.to_string();
905905
let appended = source.clone() + "_" + &name;
906906
self.functions.push(Function::Imported {
907907
source,
@@ -912,8 +912,8 @@ impl WasmModule {
912912
});
913913
}
914914
ImportSectionEntryType::Global(global_ty) => {
915-
let source = str::from_utf8(module).unwrap().to_string();
916-
let name = str::from_utf8(field).unwrap().to_string();
915+
let source = module.to_string();
916+
let name = field.to_string();
917917
let appended = source.clone() + "_" + &name;
918918

919919
self.globals.push(Global::Imported {
@@ -959,7 +959,7 @@ impl WasmModule {
959959
fn process_export_section(&mut self, p: &mut Parser) -> ProcessState {
960960
match p.read() {
961961
&ParserState::ExportSectionEntry { field, kind, index } => {
962-
let name = str::from_utf8(field).unwrap().to_string();
962+
let name = field.to_string();
963963
let export = match kind {
964964
ExternalKind::Function => Export::Function {
965965
name,

0 commit comments

Comments
 (0)