Make wasm_unsupported be composeable
This commit is contained in:
committed by
Benjamin Bouvier
parent
26accbadf8
commit
eeb3159fe9
@@ -53,7 +53,12 @@ pub fn parse_type_section(
|
||||
}));
|
||||
environ.declare_signature(sig)?;
|
||||
}
|
||||
ty => wasm_unsupported!("unsupported type in type section: {:?}", ty),
|
||||
ty => {
|
||||
return Err(wasm_unsupported!(
|
||||
"unsupported type in type section: {:?}",
|
||||
ty
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
@@ -209,7 +214,10 @@ pub fn parse_global_section(
|
||||
GlobalInit::GetGlobal(GlobalIndex::from_u32(global_index))
|
||||
}
|
||||
ref s => {
|
||||
wasm_unsupported!("unsupported init expr in global section: {:?}", s);
|
||||
return Err(wasm_unsupported!(
|
||||
"unsupported init expr in global section: {:?}",
|
||||
s
|
||||
));
|
||||
}
|
||||
};
|
||||
let global = Global {
|
||||
@@ -284,7 +292,10 @@ pub fn parse_element_section<'data>(
|
||||
(Some(GlobalIndex::from_u32(global_index)), 0)
|
||||
}
|
||||
ref s => {
|
||||
wasm_unsupported!("unsupported init expr in element section: {:?}", s);
|
||||
return Err(wasm_unsupported!(
|
||||
"unsupported init expr in element section: {:?}",
|
||||
s
|
||||
));
|
||||
}
|
||||
};
|
||||
let items_reader = items.get_items_reader()?;
|
||||
@@ -300,7 +311,10 @@ pub fn parse_element_section<'data>(
|
||||
elems.into_boxed_slice(),
|
||||
)?
|
||||
} else {
|
||||
wasm_unsupported!("unsupported passive elements section: {:?}", kind);
|
||||
return Err(wasm_unsupported!(
|
||||
"unsupported passive elements section: {:?}",
|
||||
kind
|
||||
));
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
@@ -340,7 +354,12 @@ pub fn parse_data_section<'data>(
|
||||
Operator::GetGlobal { global_index } => {
|
||||
(Some(GlobalIndex::from_u32(global_index)), 0)
|
||||
}
|
||||
ref s => wasm_unsupported!("unsupported init expr in data section: {:?}", s),
|
||||
ref s => {
|
||||
return Err(wasm_unsupported!(
|
||||
"unsupported init expr in data section: {:?}",
|
||||
s
|
||||
))
|
||||
}
|
||||
};
|
||||
environ.declare_data_initialization(
|
||||
MemoryIndex::from_u32(memory_index),
|
||||
@@ -349,7 +368,10 @@ pub fn parse_data_section<'data>(
|
||||
data,
|
||||
)?;
|
||||
} else {
|
||||
wasm_unsupported!("unsupported passive data section: {:?}", kind);
|
||||
return Err(wasm_unsupported!(
|
||||
"unsupported passive data section: {:?}",
|
||||
kind
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user