mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 23:18:01 +00:00
Bump wasmtime again (#5950)
* Update wasmtime (#5822) * update wasmtime * update tests * Update client/executor/wasmtime/src/host.rs Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com> * wip * use master-candidate * update with patches * update versions Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Bump version * Added parallel execution test Co-authored-by: Nikolay Volf <nikvolf@gmail.com> Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -21,6 +21,7 @@ use sc_executor_common::{
|
||||
use sp_wasm_interface::Value;
|
||||
use cranelift_codegen::ir;
|
||||
use cranelift_wasm::GlobalIndex;
|
||||
use wasmtime_runtime::{ExportGlobal, Export};
|
||||
|
||||
/// A snapshot of a global variables values. This snapshot can be used later for restoring the
|
||||
/// values to the preserved state.
|
||||
@@ -37,17 +38,15 @@ impl GlobalsSnapshot {
|
||||
pub fn take(instance_wrapper: &InstanceWrapper) -> Result<Self> {
|
||||
// EVIL:
|
||||
// Usage of an undocumented function.
|
||||
let handle = instance_wrapper.instance.handle().clone();
|
||||
let handle = unsafe { instance_wrapper.instance.handle().clone() };
|
||||
|
||||
let mut preserved_mut_globals = vec![];
|
||||
|
||||
for global_idx in instance_wrapper.imported_globals_count..instance_wrapper.globals_count {
|
||||
let (def, global) = match handle.lookup_by_declaration(
|
||||
&wasmtime_environ::Export::Global(GlobalIndex::from_u32(global_idx)),
|
||||
&wasmtime_environ::EntityIndex::Global(GlobalIndex::from_u32(global_idx)),
|
||||
) {
|
||||
wasmtime_runtime::Export::Global {
|
||||
definition, global, ..
|
||||
} => (definition, global),
|
||||
Export::Global(ExportGlobal { definition, global, .. }) => (definition, global),
|
||||
_ => unreachable!("only globals can be returned for a global request"),
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user