coverage. Fix panic when generating mcdc code for inlined functions

This commit is contained in:
zhuyunxing 2024-07-02 18:34:26 +08:00
parent c77788f011
commit 83fa6b726a
4 changed files with 85 additions and 0 deletions

View file

@ -41,6 +41,12 @@ struct CallSite<'tcx> {
impl<'tcx> MirPass<'tcx> for Inline {
fn is_enabled(&self, sess: &rustc_session::Session) -> bool {
// FIXME(#127234): Coverage instrumentation currently doesn't handle inlined
// MIR correctly when Modified Condition/Decision Coverage is enabled.
if sess.instrument_coverage_mcdc() {
return false;
}
if let Some(enabled) = sess.opts.unstable_opts.inline_mir {
return enabled;
}