cranelift: Prevent panics when dividing INT_MIN / -1 in interpreter

This commit is contained in:
Afonso Bordado
2021-08-23 15:33:50 +01:00
committed by Andrew Brown
parent 7b8ab065c6
commit 3f6b889067
4 changed files with 48 additions and 2 deletions

View File

@@ -81,6 +81,9 @@ where
Err(ValueError::IntegerDivisionByZero) => Ok(ControlFlow::Trap(CraneliftTrap::User(
TrapCode::IntegerDivisionByZero,
))),
Err(ValueError::IntegerOverflow) => Ok(ControlFlow::Trap(CraneliftTrap::User(
TrapCode::IntegerOverflow,
))),
Err(e) => Err(e),
};