mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
an attempt to fix the repl tests
This commit is contained in:
parent
13fcef3e2c
commit
82ca7fc8c5
1 changed files with 22 additions and 0 deletions
|
@ -155,10 +155,32 @@ pub fn add_default_roc_externs(env: &Env<'_, '_, '_>) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unreachable_function(env, "roc_getppid");
|
||||||
|
unreachable_function(env, "roc_mmap");
|
||||||
|
unreachable_function(env, "roc_send_signal");
|
||||||
|
unreachable_function(env, "roc_shm_open");
|
||||||
|
|
||||||
add_sjlj_roc_panic(env)
|
add_sjlj_roc_panic(env)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn unreachable_function(env: &Env, name: &str) {
|
||||||
|
// The type of this function (but not the implementation) should have
|
||||||
|
// already been defined by the builtins, which rely on it.
|
||||||
|
let fn_val = env.module.get_function(name).unwrap();
|
||||||
|
|
||||||
|
// Add a basic block for the entry point
|
||||||
|
let entry = env.context.append_basic_block(fn_val, "entry");
|
||||||
|
|
||||||
|
env.builder.position_at_end(entry);
|
||||||
|
|
||||||
|
env.builder.build_unreachable();
|
||||||
|
|
||||||
|
if cfg!(debug_assertions) {
|
||||||
|
crate::llvm::build::verify_fn(fn_val);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn add_sjlj_roc_panic(env: &Env<'_, '_, '_>) {
|
pub fn add_sjlj_roc_panic(env: &Env<'_, '_, '_>) {
|
||||||
let ctx = env.context;
|
let ctx = env.context;
|
||||||
let module = env.module;
|
let module = env.module;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue