Added probestack to LibCall

This commit is contained in:
Syrus 2018-12-10 16:22:56 -08:00
parent 5dac9b489a
commit 707f30757c

View File

@ -329,10 +329,17 @@ impl Instance {
RelocationType::LibCall(LibCall::NearestF64) => {
math_intrinsics::nearbyintf64 as isize
},
_ => unimplemented!()
// RelocationType::Intrinsic(name) => {
// get_abi_intrinsic(name)?
// },
RelocationType::LibCall(LibCall::Probestack) => {
__rust_probestack as isize
},
RelocationType::LibCall(call) => {
panic!("Unexpected libcall {}", call);
},
RelocationType::Intrinsic(ref name) => {
panic!("Unexpected intrinsic {}", name);
// get_abi_intrinsic(name)?
},
// _ => unimplemented!()
};
let func_addr =
@ -677,3 +684,9 @@ extern "C" fn current_memory(memory_index: u32, instance: &mut Instance) -> u32
let memory = &instance.memories[memory_index as usize];
memory.current_pages() as u32
}
/// A declaration for the stack probe function in Rust's standard library, for
/// catching callstack overflow.
extern "C" {
pub fn __rust_probestack();
}