Revert "Update wasmtime (#5822)" (#5935)

This reverts commit e5163380e7.

We found some bugs that we first need to fix.
This commit is contained in:
Bastian Köcher
2020-05-07 11:47:38 +02:00
committed by GitHub
parent d8b7520a90
commit eff1680aed
8 changed files with 168 additions and 198 deletions
@@ -21,7 +21,6 @@ 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.
@@ -44,9 +43,11 @@ impl GlobalsSnapshot {
for global_idx in instance_wrapper.imported_globals_count..instance_wrapper.globals_count {
let (def, global) = match handle.lookup_by_declaration(
&wasmtime_environ::EntityIndex::Global(GlobalIndex::from_u32(global_idx)),
&wasmtime_environ::Export::Global(GlobalIndex::from_u32(global_idx)),
) {
Export::Global(ExportGlobal { definition, global, .. }) => (definition, global),
wasmtime_runtime::Export::Global {
definition, global, ..
} => (definition, global),
_ => unreachable!("only globals can be returned for a global request"),
};