Skip to content
Snippets Groups Projects
Commit 2d04fa87 authored by Lldenaurois's avatar Lldenaurois Committed by GitHub
Browse files

Add function to test whether function is exported in wasm blob (#9093)

* Add function to test whether function is exported in wasm blob

* Address Feedback

* Update based on feedback
parent e508536c
Branches
No related merge requests found
......@@ -81,6 +81,15 @@ impl RuntimeBlob {
export_mutable_globals(&mut self.raw_module, "exported_internal_global");
}
/// Perform an instrumentation that makes sure that a specific function `entry_point` is exported
pub fn entry_point_exists(&self, entry_point: &str) -> bool {
self.raw_module.export_section().map(|e| {
e.entries()
.iter()
.any(|e| matches!(e.internal(), Internal::Function(_)) && e.field() == entry_point)
}).unwrap_or_default()
}
/// Returns an iterator of all globals which were exported by [`expose_mutable_globals`].
pub(super) fn exported_internal_global_names<'module>(
&'module self,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment