mirror of
https://github.com/fluencelabs/parity-wasm
synced 2025-05-24 05:01:34 +00:00
Fix native_env_global.
This commit is contained in:
parent
d8bfb02fa5
commit
a49cdfbadb
@ -381,9 +381,16 @@ fn native_env_global() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn native_custom_error() {
|
fn native_custom_error() {
|
||||||
let program = ProgramInstance::with_emscripten_env(Default::default()).unwrap();
|
let program = ProgramInstance::new();
|
||||||
let env_instance = program.module("env").unwrap();
|
let env_module = module()
|
||||||
|
.memory()
|
||||||
|
.with_min(1)
|
||||||
|
.build()
|
||||||
|
.with_export(ExportEntry::new("memory".into(), Internal::Memory(0)))
|
||||||
|
.build();
|
||||||
|
let env_instance = program.add_module("env", env_module, None).unwrap();
|
||||||
let env_memory = env_instance.memory(ItemIndex::Internal(0)).unwrap();
|
let env_memory = env_instance.memory(ItemIndex::Internal(0)).unwrap();
|
||||||
|
|
||||||
let mut executor = FunctionExecutor { memory: env_memory.clone(), values: Vec::new() };
|
let mut executor = FunctionExecutor { memory: env_memory.clone(), values: Vec::new() };
|
||||||
let functions = UserDefinedElements {
|
let functions = UserDefinedElements {
|
||||||
executor: Some(&mut executor),
|
executor: Some(&mut executor),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user