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:
@@ -205,6 +205,7 @@ impl CompiledModule {
|
||||
/// See `InstanceHandle::new`
|
||||
pub unsafe fn instantiate(
|
||||
&self,
|
||||
is_bulk_memory: bool,
|
||||
resolver: &mut dyn Resolver,
|
||||
) -> Result<InstanceHandle, InstantiationError> {
|
||||
let data_initializers = self
|
||||
@@ -224,6 +225,7 @@ impl CompiledModule {
|
||||
&data_initializers,
|
||||
self.signatures.clone(),
|
||||
self.dbg_jit_registration.as_ref().map(|r| Rc::clone(&r)),
|
||||
is_bulk_memory,
|
||||
Box::new(()),
|
||||
)
|
||||
}
|
||||
@@ -277,9 +279,10 @@ pub unsafe fn instantiate(
|
||||
data: &[u8],
|
||||
resolver: &mut dyn Resolver,
|
||||
debug_info: bool,
|
||||
is_bulk_memory: bool,
|
||||
profiler: Option<&Arc<Mutex<Box<dyn ProfilingAgent + Send>>>>,
|
||||
) -> Result<InstanceHandle, SetupError> {
|
||||
let instance =
|
||||
CompiledModule::new(compiler, data, debug_info, profiler)?.instantiate(resolver)?;
|
||||
let instance = CompiledModule::new(compiler, data, debug_info, profiler)?
|
||||
.instantiate(is_bulk_memory, resolver)?;
|
||||
Ok(instance)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user