Fix runtime error catching (#157)

This commit is contained in:
Lachlan Sneff
2019-02-07 14:44:28 -08:00
committed by GitHub
parent ea2bd80089
commit 8d2c1956d7
6 changed files with 127 additions and 25 deletions

View File

@ -83,12 +83,23 @@ impl PartialEq for LinkError {
/// Comparing two `RuntimeError`s always evaluates to false.
#[derive(Debug, Clone)]
pub enum RuntimeError {
OutOfBoundsAccess { memory: MemoryIndex, addr: u32 },
TableOutOfBounds { table: TableIndex },
IndirectCallSignature { table: TableIndex },
IndirectCallToNull { table: TableIndex },
OutOfBoundsAccess {
memory: MemoryIndex,
addr: Option<u32>,
},
TableOutOfBounds {
table: TableIndex,
},
IndirectCallSignature {
table: TableIndex,
},
IndirectCallToNull {
table: TableIndex,
},
IllegalArithmeticOperation,
Unknown { msg: String },
Unknown {
msg: String,
},
}
impl PartialEq for RuntimeError {