diff options
| author | Matthew Maurer <mmaurer@google.com> | 2024-04-02 18:23:28 +0000 |
|---|---|---|
| committer | Matthew Maurer <mmaurer@google.com> | 2024-04-02 18:24:44 +0000 |
| commit | 93c2bace58b36ba297f06505b55aef5b8eba954f (patch) | |
| tree | a160c24ff661df66a79495e58b4982844590910c /compiler/rustc_codegen_llvm/src/declare.rs | |
| parent | 36b6f9b58e78a1225a322a759e42c262e6dc8d5d (diff) | |
| download | rust-93c2bace58b36ba297f06505b55aef5b8eba954f.tar.gz rust-93c2bace58b36ba297f06505b55aef5b8eba954f.zip | |
CFI: Switch sense of type erasure flag
Previously, we had `NO_SELF_TYPE_ERASURE`, a negative configuration. Now we have `ERASE_SELF_TYPE`, a positive configuration.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/declare.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/declare.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_llvm/src/declare.rs b/compiler/rustc_codegen_llvm/src/declare.rs index 3ef8538ced3..f58dd4066ad 100644 --- a/compiler/rustc_codegen_llvm/src/declare.rs +++ b/compiler/rustc_codegen_llvm/src/declare.rs @@ -147,7 +147,7 @@ impl<'ll, 'tcx> CodegenCx<'ll, 'tcx> { for options in [ TypeIdOptions::GENERALIZE_POINTERS, TypeIdOptions::NORMALIZE_INTEGERS, - TypeIdOptions::NO_SELF_TYPE_ERASURE, + TypeIdOptions::ERASE_SELF_TYPE, ] .into_iter() .powerset() @@ -173,7 +173,9 @@ impl<'ll, 'tcx> CodegenCx<'ll, 'tcx> { if self.tcx.sess.is_sanitizer_kcfi_enabled() { // LLVM KCFI does not support multiple !kcfi_type attachments - let mut options = TypeIdOptions::empty(); + // Default to erasing the self type. If we need the concrete type, there will be a + // hint in the instance. + let mut options = TypeIdOptions::ERASE_SELF_TYPE; if self.tcx.sess.is_sanitizer_cfi_generalize_pointers_enabled() { options.insert(TypeIdOptions::GENERALIZE_POINTERS); } |
