ScalarInt: add methods to assert being a (u)int of given size
This commit is contained in:
parent
5e6184cdb7
commit
42220f0930
13 changed files with 78 additions and 72 deletions
|
@ -796,7 +796,7 @@ impl<'tcx> Visitor<'tcx> for ConstPropagator<'_, 'tcx> {
|
|||
if let Some(ref value) = self.eval_operand(discr)
|
||||
&& let Some(value_const) = self.use_ecx(|this| this.ecx.read_scalar(value))
|
||||
&& let Ok(constant) = value_const.try_to_int()
|
||||
&& let Ok(constant) = constant.to_bits(constant.size())
|
||||
&& let Ok(constant) = constant.try_to_bits(constant.size())
|
||||
{
|
||||
// We managed to evaluate the discriminant, so we know we only need to visit
|
||||
// one target.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue