aboutsummaryrefslogtreecommitdiffstats
path: root/vm
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-13 01:22:35 +0800
committerobscuren <geffobscura@gmail.com>2015-03-13 01:22:35 +0800
commit83cc08f67060faf9c53bd1f81b69a68c6311d345 (patch)
tree61c2d79e1bac9767cfe3c5a7bc40d964aa9e810b /vm
parentd11fabd2ef507d768977a26c85d6ace2060c4660 (diff)
downloadgo-tangerine-83cc08f67060faf9c53bd1f81b69a68c6311d345.tar
go-tangerine-83cc08f67060faf9c53bd1f81b69a68c6311d345.tar.gz
go-tangerine-83cc08f67060faf9c53bd1f81b69a68c6311d345.tar.bz2
go-tangerine-83cc08f67060faf9c53bd1f81b69a68c6311d345.tar.lz
go-tangerine-83cc08f67060faf9c53bd1f81b69a68c6311d345.tar.xz
go-tangerine-83cc08f67060faf9c53bd1f81b69a68c6311d345.tar.zst
go-tangerine-83cc08f67060faf9c53bd1f81b69a68c6311d345.zip
Changed to big.Int.Not
Diffstat (limited to 'vm')
-rw-r--r--vm/vm.go17
1 files changed, 7 insertions, 10 deletions
diff --git a/vm/vm.go b/vm/vm.go
index 6e4a54844..0cf1f9af3 100644
--- a/vm/vm.go
+++ b/vm/vm.go
@@ -254,12 +254,10 @@ func (self *Vm) Run(me, caller ContextRef, code []byte, value, gas, price *big.I
stack.push(num)
}
case NOT:
- base.Sub(Pow256, stack.pop()).Sub(base, ethutil.Big1)
-
- // Not needed
- base = U256(base)
-
- stack.push(base)
+ stack.push(U256(new(big.Int).Not(stack.pop())))
+ //base.Sub(Pow256, stack.pop()).Sub(base, ethutil.Big1)
+ //base = U256(base)
+ //stack.push(base)
case LT:
x, y := stack.pop(), stack.pop()
self.Printf(" %v < %v", x, y)
@@ -349,16 +347,15 @@ func (self *Vm) Run(me, caller ContextRef, code []byte, value, gas, price *big.I
stack.push(base)
case ADDMOD:
-
x := stack.pop()
y := stack.pop()
z := stack.pop()
- add := new(big.Int).Add(x, y)
- if len(z.Bytes()) > 0 { // NOT 0x0
+ if z.Cmp(Zero) > 0 {
+ add := U256(new(big.Int).Add(x, y))
base.Mod(add, z)
- U256(base)
+ base = U256(base)
}
self.Printf(" %v + %v %% %v = %v", x, y, z, base)