Fix merge errors and update llvm to use the new runtime error type.

This commit is contained in:
Lachlan Sneff 2019-03-04 13:10:28 -08:00
parent 4e198bca8b
commit 039ebdcf75
3 changed files with 1694 additions and 14 deletions

1682
Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,7 @@ authors = ["Lachlan Sneff <lachlan.sneff@gmail.com>"]
edition = "2018"
[dependencies]
wasmer-runtime-core = { path = "../runtime-core", version = "0.1.2" }
wasmer-runtime-core = { path = "../runtime-core", version = "0.2.1" }
wasmparser = "0.28.0"
inkwell = { git = "https://github.com/TheDan64/inkwell", branch = "llvm7-0" }
hashbrown = "0.1.8"

View File

@ -10,6 +10,7 @@ use libc::{
PROT_WRITE,
};
use std::{
any::Any,
ffi::CString,
mem,
ptr::{self, NonNull},
@ -397,20 +398,17 @@ impl ProtectedCaller for LLVMProtectedCaller {
.collect())
} else {
Err(match trap_out {
WasmTrapType::Unreachable => RuntimeError::User {
WasmTrapType::Unreachable => RuntimeError::Trap {
msg: "unreachable".into(),
},
WasmTrapType::IncorrectCallIndirectSignature => {
RuntimeError::IndirectCallSignature {
table: TableIndex::new(0),
}
}
WasmTrapType::MemoryOutOfBounds => RuntimeError::OutOfBoundsAccess {
memory: MemoryIndex::new(0),
addr: None,
WasmTrapType::IncorrectCallIndirectSignature => RuntimeError::Trap {
msg: "uncorrect call_indirect signature".into(),
},
WasmTrapType::Unknown => RuntimeError::Unknown {
msg: "unknown error".into(),
WasmTrapType::MemoryOutOfBounds => RuntimeError::Trap {
msg: "memory out-of-bounds access".into(),
},
WasmTrapType::Unknown => RuntimeError::Trap {
msg: "unknown trap".into(),
},
})
}
@ -422,8 +420,8 @@ impl ProtectedCaller for LLVMProtectedCaller {
}
impl UserTrapper for Placeholder {
unsafe fn do_early_trap(&self, msg: String) -> ! {
unimplemented!("do early trap: {}", msg)
unsafe fn do_early_trap(&self, _data: Box<dyn Any>) -> ! {
unimplemented!("do early trap")
}
}