fix ICE by u64::try_from(<u128>)
This commit is contained in:
parent
f54275f20f
commit
3665a4102b
2 changed files with 5 additions and 1 deletions
|
|
@ -44,7 +44,7 @@ fn apply_reductions(cx: &LateContext<'_>, nbits: u64, expr: &Expr<'_>, signed: b
|
|||
.unwrap_or(u64::max_value())
|
||||
.min(apply_reductions(cx, nbits, left, signed)),
|
||||
BinOpKind::Shr => apply_reductions(cx, nbits, left, signed)
|
||||
.saturating_sub(constant_int(cx, right).map_or(0, |s| u64::try_from(s).expect("shift too high"))),
|
||||
.saturating_sub(constant_int(cx, right).map_or(0, |s| u64::try_from(s).unwrap_or_default())),
|
||||
_ => nbits,
|
||||
},
|
||||
ExprKind::MethodCall(method, left, [right], _) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue