aboutsummaryrefslogtreecommitdiffstats
path: root/vm
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-12-05 21:52:36 +0800
committerobscuren <geffobscura@gmail.com>2014-12-05 21:52:36 +0800
commit095cb976758e942b7beba8231686a7738a283e19 (patch)
tree62438a32896bb2beba7de7982dab688181249d4a /vm
parentd80f8bda940a8ae8f6dab1502a46054c06cee5cc (diff)
downloadgo-tangerine-095cb976758e942b7beba8231686a7738a283e19.tar
go-tangerine-095cb976758e942b7beba8231686a7738a283e19.tar.gz
go-tangerine-095cb976758e942b7beba8231686a7738a283e19.tar.bz2
go-tangerine-095cb976758e942b7beba8231686a7738a283e19.tar.lz
go-tangerine-095cb976758e942b7beba8231686a7738a283e19.tar.xz
go-tangerine-095cb976758e942b7beba8231686a7738a283e19.tar.zst
go-tangerine-095cb976758e942b7beba8231686a7738a283e19.zip
EXP simplified
Diffstat (limited to 'vm')
-rw-r--r--vm/vm_debug.go8
1 files changed, 1 insertions, 7 deletions
diff --git a/vm/vm_debug.go b/vm/vm_debug.go
index 956a16da2..be1c59339 100644
--- a/vm/vm_debug.go
+++ b/vm/vm_debug.go
@@ -166,13 +166,7 @@ func (self *DebugVm) Run(me, caller ClosureRef, code []byte, value, gas, price *
case EXP:
require(2)
- exp := new(big.Int).Set(stack.data[stack.Len()-2])
- nbytes := 0
- for exp.Cmp(ethutil.Big0) > 0 {
- nbytes += 1
- exp.Rsh(exp, 8)
- }
- gas.Set(big.NewInt(int64(nbytes + 1)))
+ gas.Set(big.NewInt(int64(len(stack.data[stack.Len()-2].Bytes()) + 1)))
// Gas only
case STOP:
gas.Set(ethutil.Big0)