Skip to content

Commit

Permalink
Fix issue 57762
Browse files Browse the repository at this point in the history
Issue 57762 points out a compiler crash when the compiler was built
using a stock LLVM 7.  LLVM 7 was released without a necessary fix for
a bug in the DWARF discriminant code.

This patch changes rustc to use the fallback mode on (non-Rust) LLVM 7.

Closes rust-lang#57762
  • Loading branch information
tromey committed Jan 22, 2019
1 parent 76c87a1 commit 1c95f5a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/librustc_codegen_llvm/debuginfo/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,11 @@ fn use_enum_fallback(cx: &CodegenCx) -> bool {
// On MSVC we have to use the fallback mode, because LLVM doesn't
// lower variant parts to PDB.
return cx.sess().target.target.options.is_like_msvc
|| llvm_util::get_major_version() < 7;
|| llvm_util::get_major_version() < 7
// LLVM version 7 did not release with an important bug fix;
// but the required patch is in the equivalent Rust LLVM.
// See https://github.com/rust-lang/rust/issues/57762.
|| (llvm_util::get_major_version() == 7 && unsafe { !llvm::LLVMRustIsRustLLVM() });
}

// Describes the members of an enum value: An enum is described as a union of
Expand Down

0 comments on commit 1c95f5a

Please sign in to comment.