Implement bulk memory's partial failure instantiation semantics

Essentially, table and memory out of bounds errors are no longer link errors,
but traps after linking. This means that the partail writes / inits are visible.
This commit is contained in:
Nick Fitzgerald
2020-02-20 16:19:36 -08:00
parent 44c28612fb
commit 81227892da
6 changed files with 88 additions and 15 deletions

View File

@@ -24,7 +24,17 @@ fn test_environ_translate() {
let cache_config = CacheConfig::new_cache_disabled();
let mut compiler = Compiler::new(isa, CompilationStrategy::Auto, cache_config);
unsafe {
let instance = instantiate(&mut compiler, &data, &mut resolver, false, None);
let instance = instantiate(
&mut compiler,
&data,
&mut resolver,
// Bulk memory.
false,
// Debug info.
false,
// Profiler.
None,
);
assert!(instance.is_ok());
}
}