mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-30 17:11:33 +00:00
Fix tests for the Cranelift backend
This commit is contained in:
@ -56,7 +56,7 @@ extern "C" {
|
||||
/// but this is cleaner, I think?
|
||||
#[cfg_attr(nightly, unwind(allowed))]
|
||||
#[allow(improper_ctypes)]
|
||||
fn throw_runtime_error(data: RuntimeError) -> !;
|
||||
fn throw_runtime_error(data: *mut Option<RuntimeError>) -> !;
|
||||
|
||||
#[allow(improper_ctypes)]
|
||||
fn cxx_invoke_trampoline(
|
||||
@ -475,8 +475,7 @@ impl RunnableModule for LLVMBackend {
|
||||
}
|
||||
|
||||
unsafe fn do_early_trap(&self, data: RuntimeError) -> ! {
|
||||
// maybe need to box leak it?
|
||||
throw_runtime_error(data)
|
||||
throw_runtime_error(Box::into_raw(Box::new(Some(data))))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -35,6 +35,7 @@ use wasmer_runtime_core::{
|
||||
backend::{CacheGen, CompilerConfig, Token},
|
||||
cache::{Artifact, Error as CacheError},
|
||||
codegen::*,
|
||||
error::RuntimeError,
|
||||
memory::MemoryType,
|
||||
module::{ModuleInfo, ModuleInner},
|
||||
parse::{wp_type_to_type, LoadError},
|
||||
@ -940,12 +941,11 @@ pub struct CodegenError {
|
||||
// prevents unused function elimination.
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn callback_trampoline(
|
||||
b: *mut Option<Box<dyn std::any::Any>>,
|
||||
b: *mut Option<RuntimeError>,
|
||||
callback: *mut BreakpointHandler,
|
||||
) {
|
||||
let callback = Box::from_raw(callback);
|
||||
let result: Result<(), Box<dyn std::any::Any + Send>> =
|
||||
callback(BreakpointInfo { fault: None });
|
||||
let result: Result<(), RuntimeError> = callback(BreakpointInfo { fault: None });
|
||||
match result {
|
||||
Ok(()) => *b = None,
|
||||
Err(e) => *b = Some(e),
|
||||
|
Reference in New Issue
Block a user