Closed LaurentAjdnik closed 2 years ago
I think the bind
function in qirlib/src/evaluation/runtime.rs
needs to be updated to something like
fn bind(module: &Module<'ctx>, ee: &ExecutionEngine<'ctx>) -> Result<(), String> {
let unknown_functions = module_functions(module).filter(|f| {
is_extern(*f) && !is_supported_qis_instrinsic(*f) && !is_supported_rt_instrinsic(*f)
});
// if collection isn't empty, bubble up error about unsupported functions
module_functions
is defined in qirlib/src/evaluation/jit.rs
but the other functions don't exist.
Describe the bug
When an LLVM file contains declarations of external functions that are unknown, the evaluator crashes without displaying an error message or raising an Exception.
Issue related to #121.
To Reproduce
Use an LLVM file that contains unknown external functions, such as:
This evaluation does not reach the end and throws no Exception:
Expected behavior
The evaluator should either: