Tidy up trap-handling code.

This commit is contained in:
Dan Gohman
2018-12-19 15:12:56 -08:00
parent 4d4ecfd812
commit c4e10227de
13 changed files with 60 additions and 21 deletions

View File

@@ -7,7 +7,7 @@ use target_lexicon::HOST;
use wasmtime_environ::{
translate_signature, Export, MemoryPlan, MemoryStyle, Module, TablePlan, TableStyle,
};
use wasmtime_execute::{ActionError, InstancePlus};
use wasmtime_execute::{target_tunables, ActionError, InstancePlus};
use wasmtime_runtime::{Imports, VMFunctionBody};
extern "C" fn spectest_print() {}
@@ -199,14 +199,17 @@ pub fn instantiate_spectest() -> Result<InstancePlus, ActionError> {
.exports
.insert("table".to_owned(), Export::Table(table));
let tunables = target_tunables(&HOST);
let memory = module.memory_plans.push(MemoryPlan {
memory: Memory {
minimum: 1,
maximum: Some(2),
shared: false,
},
style: MemoryStyle::Static { bound: 65536 },
offset_guard_size: 0x80000000,
style: MemoryStyle::Static {
bound: tunables.static_memory_bound,
},
offset_guard_size: tunables.static_memory_offset_guard_size,
});
module
.exports

View File

@@ -253,7 +253,7 @@ impl WastContext {
) -> Result<(), WastFileError> {
let mut parser = ScriptParser::from_str(str::from_utf8(wast).unwrap()).unwrap();
while let Some(Command { kind, line }) = parser.next().unwrap() {
while let Some(Command { kind, line }) = parser.next().expect("parser") {
match kind {
CommandKind::Module { module, name } => {
self.module(isa, name, module)