Merge remote-tracking branch 'origin/master' into feature/wasi-readlink

This commit is contained in:
Mark McCaskey
2019-07-16 13:50:56 -07:00
32 changed files with 332 additions and 45 deletions

View File

@ -117,6 +117,7 @@ pub struct CompilerConfig {
pub symbol_map: Option<HashMap<u32, String>>,
pub memory_bound_check_mode: MemoryBoundCheckMode,
pub enforce_stack_check: bool,
pub track_state: bool,
}
pub trait Compiler {

View File

@ -111,7 +111,13 @@ impl ModuleStateMap {
.unwrap();
match fsm.call_offsets.get(&(ip - base)) {
Some(x) => Some((fsm, fsm.diffs[x.diff_id].build_state(fsm))),
Some(x) => {
if x.diff_id < fsm.diffs.len() {
Some((fsm, fsm.diffs[x.diff_id].build_state(fsm)))
} else {
None
}
}
None => None,
}
}
@ -132,7 +138,13 @@ impl ModuleStateMap {
.unwrap();
match fsm.trappable_offsets.get(&(ip - base)) {
Some(x) => Some((fsm, fsm.diffs[x.diff_id].build_state(fsm))),
Some(x) => {
if x.diff_id < fsm.diffs.len() {
Some((fsm, fsm.diffs[x.diff_id].build_state(fsm)))
} else {
None
}
}
None => None,
}
}
@ -149,7 +161,13 @@ impl ModuleStateMap {
.unwrap();
match fsm.loop_offsets.get(&(ip - base)) {
Some(x) => Some((fsm, fsm.diffs[x.diff_id].build_state(fsm))),
Some(x) => {
if x.diff_id < fsm.diffs.len() {
Some((fsm, fsm.diffs[x.diff_id].build_state(fsm)))
} else {
None
}
}
None => None,
}
}

View File

@ -74,7 +74,7 @@ pub struct InternalCtx {
/// A pointer to an array of locally-defined globals, indexed by `GlobalIndex`.
pub globals: *mut *mut LocalGlobal,
/// A pointer to an array of imported memories, indexed by `MemoryIndex,
/// A pointer to an array of imported memories, indexed by `MemoryIndex`,
pub imported_memories: *mut *mut LocalMemory,
/// A pointer to an array of imported tables, indexed by `TableIndex`.