diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-10-31 12:35:56 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-31 12:35:56 +0100 |
| commit | bfc956e36ff42e8699ff794297317880e80eedad (patch) | |
| tree | b97eba429f23115e617ffdb7d6b27839181b0bc3 /compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs | |
| parent | 6b96a7944a8de94eb0d80881c765e7052dbc03bd (diff) | |
| parent | 8dddd1ae603756ef4957320880115ecc65d706a5 (diff) | |
| download | rust-bfc956e36ff42e8699ff794297317880e80eedad.tar.gz rust-bfc956e36ff42e8699ff794297317880e80eedad.zip | |
Rollup merge of #132395 - Zalathar:coverage-cx-ice, r=jieyouxu
coverage: Avoid ICE when `coverage_cx` is unexpectedly unavailable In #132124, `coverage_cx()` was changed to panic if the context was unavailable, under the assumption that it would always be available whenever coverage instrumentation is enabled. However, there have been reports of this change causing ICEs in `polars` CI. I don't yet understand why this is happening, but for now it seems wisest to revert that part of the change, restoring the two early returns that had been replaced with panics.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs b/compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs index a298ed86276..e4ff50816b9 100644 --- a/compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs +++ b/compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs @@ -152,7 +152,12 @@ impl<'tcx> CoverageInfoBuilderMethods<'tcx> for Builder<'_, '_, 'tcx> { return; }; - let mut coverage_map = bx.coverage_cx().function_coverage_map.borrow_mut(); + // FIXME(#132395): Unwrapping `coverage_cx` here has led to ICEs in the + // wild, so keep this early-return until we understand why. + let mut coverage_map = match bx.coverage_cx { + Some(ref cx) => cx.function_coverage_map.borrow_mut(), + None => return, + }; let func_coverage = coverage_map .entry(instance) .or_insert_with(|| FunctionCoverageCollector::new(instance, function_coverage_info)); |
