diff options
author | obscuren <geffobscura@gmail.com> | 2014-04-11 02:40:12 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-04-11 02:40:12 +0800 |
commit | 6a530ea3717e592407737c6cd2ebeba0200c9cd8 (patch) | |
tree | bb5063b709a8d4f6f9baea6824807dd2cf0c610b /ethchain/closure.go | |
parent | 0fccbeabcc3b8c110ce3712e5488ad99245f92ee (diff) | |
download | go-tangerine-6a530ea3717e592407737c6cd2ebeba0200c9cd8.tar go-tangerine-6a530ea3717e592407737c6cd2ebeba0200c9cd8.tar.gz go-tangerine-6a530ea3717e592407737c6cd2ebeba0200c9cd8.tar.bz2 go-tangerine-6a530ea3717e592407737c6cd2ebeba0200c9cd8.tar.lz go-tangerine-6a530ea3717e592407737c6cd2ebeba0200c9cd8.tar.xz go-tangerine-6a530ea3717e592407737c6cd2ebeba0200c9cd8.tar.zst go-tangerine-6a530ea3717e592407737c6cd2ebeba0200c9cd8.zip |
Call fixed
Diffstat (limited to 'ethchain/closure.go')
-rw-r--r-- | ethchain/closure.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ethchain/closure.go b/ethchain/closure.go index d1fac0f43..8e57a0d03 100644 --- a/ethchain/closure.go +++ b/ethchain/closure.go @@ -52,6 +52,10 @@ func (c *Closure) Get(x *big.Int) *ethutil.Value { } func (c *Closure) Gets(x, y *big.Int) *ethutil.Value { + if x.Int64() > int64(len(c.Script)) || y.Int64() > int64(len(c.Script)) { + return ethutil.NewValue(0) + } + partial := c.Script[x.Int64() : x.Int64()+y.Int64()] return ethutil.NewValue(partial) |