Fortify transmute check.
This commit is contained in:
parent
fbf0a0c5ff
commit
59235a7907
@ -471,10 +471,9 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
|
|||||||
// `offset` for immediates only supports scalar/scalar-pair ABIs,
|
// `offset` for immediates only supports scalar/scalar-pair ABIs,
|
||||||
// so bail out if the target is not one.
|
// so bail out if the target is not one.
|
||||||
if value.as_mplace_or_imm().is_right() {
|
if value.as_mplace_or_imm().is_right() {
|
||||||
match to.abi {
|
match (value.layout.abi, to.abi) {
|
||||||
Abi::Scalar(..) | Abi::ScalarPair(..) => {}
|
(Abi::Scalar(..), Abi::Scalar(..)) => {}
|
||||||
_ if to.is_zst() => {}
|
(Abi::ScalarPair(..), Abi::ScalarPair(..)) => {}
|
||||||
Abi::Aggregate { .. } if to.fields.count() == 0 => {}
|
|
||||||
_ => return None,
|
_ => return None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user