Process declared element segments for "possibly exported funcs" (#2851)
Now that we're using "possibly exported" as an impactful decision for codegen (which trampolines to generate and which ABI a function has) it's important that we calculate this property of a wasm function correctly! Previously Wasmtime forgot to processed "declared" elements in apart from active/passive element segments, but this updates Wasmtime to ensure that these entries are processed and all the functions contained within are flagged as "possibly exported". Closes #2850
This commit is contained in:
@@ -948,6 +948,13 @@ pub trait ModuleEnvironment<'data>: TargetEnvironment {
|
||||
elements: Box<[FuncIndex]>,
|
||||
) -> WasmResult<()>;
|
||||
|
||||
/// Indicates that a declarative element segment was seen in the wasm
|
||||
/// module.
|
||||
fn declare_elements(&mut self, elements: Box<[FuncIndex]>) -> WasmResult<()> {
|
||||
drop(elements);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Provides the number of passive data segments up front.
|
||||
///
|
||||
/// By default this does nothing, but implementations may use this to
|
||||
|
||||
@@ -400,7 +400,7 @@ pub fn parse_element_section<'data>(
|
||||
environ.declare_passive_element(index, segments)?;
|
||||
}
|
||||
ElementKind::Declared => {
|
||||
// Nothing to do here.
|
||||
environ.declare_elements(segments)?;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user