mirror of
https://github.com/fluencelabs/wasmer
synced 2024-12-12 22:05:33 +00:00
Fix trap offset lookup.
This commit is contained in:
parent
450109e2bb
commit
977fd1e25e
@ -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,
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user