Fix division by zero during modulo operation
This commit is contained in:
parent
2c2fd8f3f9
commit
7417b58bad
6
tree.go
6
tree.go
@ -334,7 +334,11 @@ func (operation *Operation) Solution () (solution int64, err error) {
|
|||||||
if index == 0 {
|
if index == 0 {
|
||||||
solution = subSolution
|
solution = subSolution
|
||||||
} else {
|
} else {
|
||||||
solution %= subSolution
|
if subSolution == 0 {
|
||||||
|
err = ErrorDivideByZero
|
||||||
|
} else {
|
||||||
|
solution %= subSolution
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case OpcodeOr:
|
case OpcodeOr:
|
||||||
|
Loading…
Reference in New Issue
Block a user