mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-24 12:54:00 +00:00
Rollup merge of #112182 - rcvalle:rust-cfi-fix-111185, r=compiler-errors
CFI: Fix cfi with repr(transparent): transform_ty: unexpected Alias(Proj Fixes https://github.com/rust-lang/rust/issues/111185 by normalizing ty::Alias before encoding.
This commit is contained in:
commit
ec51b15b81
@ -697,12 +697,12 @@ fn encode_ty<'tcx>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Unexpected types
|
// Unexpected types
|
||||||
ty::Bound(..)
|
ty::Alias(..)
|
||||||
|
| ty::Bound(..)
|
||||||
| ty::Error(..)
|
| ty::Error(..)
|
||||||
| ty::GeneratorWitness(..)
|
| ty::GeneratorWitness(..)
|
||||||
| ty::GeneratorWitnessMIR(..)
|
| ty::GeneratorWitnessMIR(..)
|
||||||
| ty::Infer(..)
|
| ty::Infer(..)
|
||||||
| ty::Alias(..)
|
|
||||||
| ty::Placeholder(..) => {
|
| ty::Placeholder(..) => {
|
||||||
bug!("encode_ty: unexpected `{:?}`", ty.kind());
|
bug!("encode_ty: unexpected `{:?}`", ty.kind());
|
||||||
}
|
}
|
||||||
@ -946,11 +946,18 @@ fn transform_ty<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>, options: TransformTyOptio
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ty::Alias(..) => {
|
||||||
|
ty = transform_ty(
|
||||||
|
tcx,
|
||||||
|
tcx.normalize_erasing_regions(ty::ParamEnv::reveal_all(), ty),
|
||||||
|
options,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
ty::Bound(..)
|
ty::Bound(..)
|
||||||
| ty::Error(..)
|
| ty::Error(..)
|
||||||
| ty::GeneratorWitnessMIR(..)
|
| ty::GeneratorWitnessMIR(..)
|
||||||
| ty::Infer(..)
|
| ty::Infer(..)
|
||||||
| ty::Alias(..)
|
|
||||||
| ty::Param(..)
|
| ty::Param(..)
|
||||||
| ty::Placeholder(..) => {
|
| ty::Placeholder(..) => {
|
||||||
bug!("transform_ty: unexpected `{:?}`", ty.kind());
|
bug!("transform_ty: unexpected `{:?}`", ty.kind());
|
||||||
|
@ -587,6 +587,6 @@ pub fn foo149(_: Type14<Bar>, _: Type14<Bar>, _: Type14<Bar>) { }
|
|||||||
// CHECK: ![[TYPE144]] = !{i64 0, !"_ZTSFvu3refIvEE"}
|
// CHECK: ![[TYPE144]] = !{i64 0, !"_ZTSFvu3refIvEE"}
|
||||||
// CHECK: ![[TYPE145]] = !{i64 0, !"_ZTSFvu3refIvES_E"}
|
// CHECK: ![[TYPE145]] = !{i64 0, !"_ZTSFvu3refIvES_E"}
|
||||||
// CHECK: ![[TYPE146]] = !{i64 0, !"_ZTSFvu3refIvES_S_E"}
|
// CHECK: ![[TYPE146]] = !{i64 0, !"_ZTSFvu3refIvES_S_E"}
|
||||||
// CHECK: ![[TYPE147]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtC{{[[:print:]]+}}_51sanitizer_cfi_emit_type_metadata_id_itanium_cxx_abi3BarE
|
// CHECK: ![[TYPE147]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtC{{[[:print:]]+}}_51sanitizer_cfi_emit_type_metadata_id_itanium_cxx_abi3BarE"}
|
||||||
// CHECK: ![[TYPE148]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtC{{[[:print:]]+}}_51sanitizer_cfi_emit_type_metadata_id_itanium_cxx_abi3BarS_E
|
// CHECK: ![[TYPE148]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtC{{[[:print:]]+}}_51sanitizer_cfi_emit_type_metadata_id_itanium_cxx_abi3BarS_E"}
|
||||||
// CHECK: ![[TYPE149]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtC{{[[:print:]]+}}_51sanitizer_cfi_emit_type_metadata_id_itanium_cxx_abi3BarS_S_E
|
// CHECK: ![[TYPE149]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtC{{[[:print:]]+}}_51sanitizer_cfi_emit_type_metadata_id_itanium_cxx_abi3BarS_S_E"}
|
||||||
|
Loading…
Reference in New Issue
Block a user