1
Fork 0

Remove overflow checks from ConstProp.

This commit is contained in:
Camille GILLOT 2023-02-08 20:28:39 +00:00
parent 4bd2ebc58b
commit e34caaf42d
8 changed files with 88 additions and 116 deletions

View file

@ -180,12 +180,7 @@ impl<'tcx> ValueAnalysis<'tcx> for ConstAnalysis<'_, 'tcx> {
let overflow = match overflow {
FlatSet::Top => FlatSet::Top,
FlatSet::Elem(overflow) => {
if overflow {
// Overflow cannot be reliably propagated. See: https://github.com/rust-lang/rust/pull/101168#issuecomment-1288091446
FlatSet::Top
} else {
self.wrap_scalar(Scalar::from_bool(false), self.tcx.types.bool)
}
self.wrap_scalar(Scalar::from_bool(overflow), self.tcx.types.bool)
}
FlatSet::Bottom => FlatSet::Bottom,
};