Fixing division and mod

This commit is contained in:
Tomusdrw 2016-01-15 01:41:49 +01:00
parent 4520f69ed7
commit 0234a320ca
1 changed files with 2 additions and 2 deletions

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()