Fixing division and mod

This commit is contained in:
Tomusdrw 2016-01-15 01:41:49 +01:00
parent 4520f69ed7
commit 0234a320ca

View File

@ -711,7 +711,7 @@ impl Interpreter {
instructions::DIV => {
let a = stack.pop_back();
let b = stack.pop_back();
stack.push(if self.is_zero(&b) {
stack.push(if !self.is_zero(&b) {
a / b
} else {
U256::zero()
@ -720,7 +720,7 @@ impl Interpreter {
instructions::MOD => {
let a = stack.pop_back();
let b = stack.pop_back();
stack.push(if self.is_zero(&b) {
stack.push(if !self.is_zero(&b) {
a % b
} else {
U256::zero()