Lookup a table by index. # Panics Panics if `index` is out of bounds for this instance.
(&self, store: StoreId, index: TableIndex)
| 639 | /// |
| 640 | /// Panics if `index` is out of bounds for this instance. |
| 641 | pub fn get_exported_table(&self, store: StoreId, index: TableIndex) -> crate::Table { |
| 642 | let (id, def_index) = if let Some(def_index) = self.env_module().defined_table_index(index) |
| 643 | { |
| 644 | (self.id, def_index) |
| 645 | } else { |
| 646 | let import = self.imported_table(index); |
| 647 | // SAFETY: validity of this `Instance` guarantees validity of the |
| 648 | // `vmctx` pointer being read here to find the transitive |
| 649 | // `InstanceId` that the import is associated with. |
| 650 | let id = unsafe { self.sibling_vmctx(import.vmctx.as_non_null()).id }; |
| 651 | (id, import.index) |
| 652 | }; |
| 653 | crate::Table::from_raw(StoreInstanceId::new(store, id), def_index) |
| 654 | } |
| 655 | |
| 656 | /// Lookup a memory by index. |
| 657 | /// |
no test coverage detected