Use the WasmRuntime's signature list rather than keeping a separate list.
This way, if the runtime modifies the signature, such as to add special arguments, they are reflected in the resulting function defintions.
This commit is contained in:
@@ -27,8 +27,7 @@ pub enum SectionParsingError {
|
||||
pub fn parse_function_signatures(
|
||||
parser: &mut Parser,
|
||||
runtime: &mut WasmRuntime,
|
||||
) -> Result<Vec<Signature>, SectionParsingError> {
|
||||
let mut signatures: Vec<Signature> = Vec::new();
|
||||
) -> Result<(), SectionParsingError> {
|
||||
loop {
|
||||
match *parser.read() {
|
||||
ParserState::EndSection => break,
|
||||
@@ -51,12 +50,11 @@ pub fn parse_function_signatures(
|
||||
ArgumentType::new(cret_arg)
|
||||
}));
|
||||
runtime.declare_signature(&sig);
|
||||
signatures.push(sig);
|
||||
}
|
||||
ref s => return Err(SectionParsingError::WrongSectionContent(format!("{:?}", s))),
|
||||
}
|
||||
}
|
||||
Ok(signatures)
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Retrieves the imports from the imports section of the binary.
|
||||
|
||||
Reference in New Issue
Block a user