Skip to content

Commit

Permalink
Fix --emit mir handling of constants (#3276)
Browse files Browse the repository at this point in the history
It shouldn't assume that the body of statics are available otherwise the
compiler will ICE.
  • Loading branch information
celinval committed Jun 19, 2024
1 parent 1aee91f commit 51678e9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kani-compiler/src/kani_middle/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ pub fn dump_mir_items(
match item {
// Exclude FnShims and others that cannot be dumped.
MonoItem::Fn(instance) => Some(*instance),
MonoItem::Static(def) => Some((*def).into()),
MonoItem::Static(def) => {
let instance: Instance = (*def).into();
instance.has_body().then_some(instance)
}
MonoItem::GlobalAsm(_) => None,
}
}
Expand Down

0 comments on commit 51678e9

Please sign in to comment.