Skip to content

Commit

Permalink
cranelift: Print error message when basic blocks are invalid (#4591)
Browse files Browse the repository at this point in the history
  • Loading branch information
afonso360 authored Aug 9, 2022
1 parent dd6e790 commit a36a52a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cranelift/frontend/src/frontend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -619,9 +619,12 @@ impl<'a> FunctionBuilder<'a> {
{
// Iterate manually to provide more helpful error messages.
for block in self.func_ctx.blocks.keys() {
if let Err((inst, _msg)) = self.func.is_block_basic(block) {
if let Err((inst, msg)) = self.func.is_block_basic(block) {
let inst_str = self.func.dfg.display_inst(inst);
panic!("{} failed basic block invariants on {}", block, inst_str);
panic!(
"{} failed basic block invariants on {}: {}",
block, inst_str, msg
);
}
}
}
Expand Down

0 comments on commit a36a52a

Please sign in to comment.