This commit is contained in:
Heyang Zhou
2019-05-04 09:56:52 -07:00
parent c4e4efc694
commit a590d7cd07
5 changed files with 65 additions and 13 deletions

View File

@ -16,7 +16,7 @@ use hashbrown::HashMap;
#[repr(C)]
pub struct Ctx {
// `internal` must be the first field of `Ctx`.
pub(crate) internal: InternalCtx,
pub internal: InternalCtx,
pub(crate) local_functions: *const *const Func,
@ -163,6 +163,13 @@ impl Ctx {
pub unsafe fn borrow_symbol_map(&self) -> &Option<HashMap<u32, String>> {
&(*self.module).info.em_symbol_map
}
/// Returns the number of dynamic sigindices.
pub fn dynamic_sigindice_count(&self) -> usize {
unsafe {
(*self.local_backing).dynamic_sigindices.len()
}
}
}
#[doc(hidden)]