@@ -177,8 +177,8 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
177177 return Ok ( ( Scalar :: from_bool ( op ( & l, & r) ) , false , self . tcx . types . bool ) ) ;
178178 }
179179 let op: Option < fn ( i128 , i128 ) -> ( i128 , bool ) > = match bin_op {
180- Div if r == 0 => throw_panic ! ( DivisionByZero ) ,
181- Rem if r == 0 => throw_panic ! ( RemainderByZero ) ,
180+ Div if r == 0 => throw_ub ! ( DivisionByZero ) ,
181+ Rem if r == 0 => throw_ub ! ( RemainderByZero ) ,
182182 Div => Some ( i128:: overflowing_div) ,
183183 Rem => Some ( i128:: overflowing_rem) ,
184184 Add => Some ( i128:: overflowing_add) ,
@@ -234,8 +234,8 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
234234 Add => u128:: overflowing_add,
235235 Sub => u128:: overflowing_sub,
236236 Mul => u128:: overflowing_mul,
237- Div if r == 0 => throw_panic ! ( DivisionByZero ) ,
238- Rem if r == 0 => throw_panic ! ( RemainderByZero ) ,
237+ Div if r == 0 => throw_ub ! ( DivisionByZero ) ,
238+ Rem if r == 0 => throw_ub ! ( RemainderByZero ) ,
239239 Div => u128:: overflowing_div,
240240 Rem => u128:: overflowing_rem,
241241 _ => bug ! ( ) ,
0 commit comments