aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/vm.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-07-17 20:53:27 +0800
committerobscuren <geffobscura@gmail.com>2014-07-17 20:53:27 +0800
commit0415e4a637296539e7a5c09282b7aee19268e599 (patch)
treec403eac0c3d4cda7aef003bba658f7b39881cdb5 /ethchain/vm.go
parented3424ff75b396360990725afc124326dea4ab45 (diff)
downloaddexon-0415e4a637296539e7a5c09282b7aee19268e599.tar
dexon-0415e4a637296539e7a5c09282b7aee19268e599.tar.gz
dexon-0415e4a637296539e7a5c09282b7aee19268e599.tar.bz2
dexon-0415e4a637296539e7a5c09282b7aee19268e599.tar.lz
dexon-0415e4a637296539e7a5c09282b7aee19268e599.tar.xz
dexon-0415e4a637296539e7a5c09282b7aee19268e599.tar.zst
dexon-0415e4a637296539e7a5c09282b7aee19268e599.zip
Fixed coinbase copy in state
Diffstat (limited to 'ethchain/vm.go')
-rw-r--r--ethchain/vm.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/ethchain/vm.go b/ethchain/vm.go
index 58d1bee89..4fdf8b31a 100644
--- a/ethchain/vm.go
+++ b/ethchain/vm.go
@@ -456,7 +456,7 @@ func (vm *Vm) RunClosure(closure *Closure) (ret []byte, err error) {
case BYTE:
require(2)
val, th := stack.Popn()
- if th.Cmp(big.NewInt(32)) < 0 {
+ if th.Cmp(big.NewInt(32)) < 0 && th.Cmp(big.NewInt(int64(len(val.Bytes())))) < 0 {
byt := big.NewInt(int64(val.Bytes()[th.Int64()]))
stack.Push(byt)