I was trying to implement if expressions in my simple programming language and am encountering an error that seems cryptic to me. I tried writing the code myself and when I encountered this error I tried using the exact code from the jit demo for if expression but the exact same issue persisted. Here's the error "called Result::unwrap()
on an Err
value: Compilation(Verifier(VerifierErrors([VerifierError { location: block0, context: None, message: "cfg lacked the following successor(s) [block1, block2]" }, VerifierError { location: block1, cont
ext: None, message: "cfg lacked the following successor(s) [block1, block2, block3]" }, VerifierError { location: block2, context: None, message: "cfg lacked the following successor(s) [block1, block2, block3]" }, VerifierError { location
: block3, context: None, message: "cfg lacked the following successor(s) [block1, block2, block3]" }])))". Can anyone provide an explanation or at least point me in the right direction to solve this issue? I'm happy to provide any more information that would be helpful.
The cfg
passed to the verifier is incorrect. Are you reusing a Context
between multiple functions? If so make sure to .clear()
it between compiling a function to machine code and creating clif ir for the next function.
Otherwise, can you show your code?
Last updated: Dec 23 2024 at 13:07 UTC