Fix division by zero during modulo operation

This commit is contained in:
Sasha Koshka 2022-11-22 14:04:04 -05:00
parent 2c2fd8f3f9
commit 7417b58bad
1 changed files with 5 additions and 1 deletions

View File

@ -334,7 +334,11 @@ func (operation *Operation) Solution () (solution int64, err error) {
if index == 0 {
solution = subSolution
} else {
solution %= subSolution
if subSolution == 0 {
err = ErrorDivideByZero
} else {
solution %= subSolution
}
}
}
case OpcodeOr: