mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-20 04:06:30 +00:00
Merge remote-tracking branch 'origin/master' into feature/singlepass-aarch64
This commit is contained in:
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
## **[Unreleased]**
|
## **[Unreleased]**
|
||||||
|
|
||||||
|
- [#995](https://github.com/wasmerio/wasmer/pull/995) Detect when a global is read without being initialized (emit a proper error instead of panicking)
|
||||||
- [#992](https://github.com/wasmerio/wasmer/pull/992) Updates WAPM version to 0.4.1, fix arguments issue introduced in #990
|
- [#992](https://github.com/wasmerio/wasmer/pull/992) Updates WAPM version to 0.4.1, fix arguments issue introduced in #990
|
||||||
- [#990](https://github.com/wasmerio/wasmer/pull/990) Default wasmer CLI to `run`. Wasmer will now attempt to parse unrecognized command line options as if they were applied to the run command: `wasmer mywasm.wasm --dir=.` now works!
|
- [#990](https://github.com/wasmerio/wasmer/pull/990) Default wasmer CLI to `run`. Wasmer will now attempt to parse unrecognized command line options as if they were applied to the run command: `wasmer mywasm.wasm --dir=.` now works!
|
||||||
- [#987](https://github.com/wasmerio/wasmer/pull/987) Fix `runtime-c-api` header files when compiled by gnuc.
|
- [#987](https://github.com/wasmerio/wasmer/pull/987) Fix `runtime-c-api` header files when compiled by gnuc.
|
||||||
|
@ -77,7 +77,7 @@ impl LocalBacking {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
let mut tables = Self::generate_tables(module);
|
let mut tables = Self::generate_tables(module);
|
||||||
let mut globals = Self::generate_globals(module, imports);
|
let mut globals = Self::generate_globals(module, imports)?;
|
||||||
|
|
||||||
// Ensure all initializers are valid before running finalizers
|
// Ensure all initializers are valid before running finalizers
|
||||||
Self::validate_memories(module, imports)?;
|
Self::validate_memories(module, imports)?;
|
||||||
@ -443,13 +443,22 @@ impl LocalBacking {
|
|||||||
fn generate_globals(
|
fn generate_globals(
|
||||||
module: &ModuleInner,
|
module: &ModuleInner,
|
||||||
imports: &ImportBacking,
|
imports: &ImportBacking,
|
||||||
) -> BoxedMap<LocalGlobalIndex, Global> {
|
) -> LinkResult<BoxedMap<LocalGlobalIndex, Global>> {
|
||||||
let mut globals = Map::with_capacity(module.info.globals.len());
|
let mut globals = Map::with_capacity(module.info.globals.len());
|
||||||
|
|
||||||
for (_, global_init) in module.info.globals.iter() {
|
for (_, global_init) in module.info.globals.iter() {
|
||||||
let value = match &global_init.init {
|
let value = match &global_init.init {
|
||||||
Initializer::Const(value) => value.clone(),
|
Initializer::Const(value) => value.clone(),
|
||||||
Initializer::GetGlobal(import_global_index) => {
|
Initializer::GetGlobal(import_global_index) => {
|
||||||
|
if imports.globals.len() <= import_global_index.index() {
|
||||||
|
return Err(vec![LinkError::Generic {
|
||||||
|
message: format!(
|
||||||
|
"Trying to read the `{:?}` global that is not properly initialized.",
|
||||||
|
import_global_index.index()
|
||||||
|
),
|
||||||
|
}]);
|
||||||
|
}
|
||||||
|
|
||||||
imports.globals[*import_global_index].get()
|
imports.globals[*import_global_index].get()
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -463,7 +472,7 @@ impl LocalBacking {
|
|||||||
globals.push(global);
|
globals.push(global);
|
||||||
}
|
}
|
||||||
|
|
||||||
globals.into_boxed_map()
|
Ok(globals.into_boxed_map())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn finalize_globals(
|
fn finalize_globals(
|
||||||
|
Reference in New Issue
Block a user