Add a FuncEnvironment::make_indirect_sig() callback.
The function environment is now expected to keep track of the function signatures in the module, and it is asked to generate Cretonne signatures to be used for indirect calls. The combination of make_indirect_sig() and translate_call_indirect() callbacks allow the runtime to insert additional function arguments for indirect calls such as vmctx pointers and CFI-style signature identifiers.
This commit is contained in:
@@ -26,6 +26,7 @@ pub enum SectionParsingError {
|
||||
/// Reads the Type Section of the wasm module and returns the corresponding function signatures.
|
||||
pub fn parse_function_signatures(
|
||||
parser: &mut Parser,
|
||||
runtime: &mut WasmRuntime,
|
||||
) -> Result<Vec<Signature>, SectionParsingError> {
|
||||
let mut signatures: Vec<Signature> = Vec::new();
|
||||
loop {
|
||||
@@ -53,6 +54,7 @@ pub fn parse_function_signatures(
|
||||
};
|
||||
ArgumentType::new(cret_arg)
|
||||
}));
|
||||
runtime.declare_signature(&sig);
|
||||
signatures.push(sig);
|
||||
}
|
||||
ref s => return Err(SectionParsingError::WrongSectionContent(format!("{:?}", s))),
|
||||
|
||||
Reference in New Issue
Block a user