diff options
author | obscuren <geffobscura@gmail.com> | 2015-06-10 16:44:46 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-06-10 16:44:46 +0800 |
commit | 468501cb860508af55e1fcd586e1498df0a2d984 (patch) | |
tree | 1831ad55bcc0f6bec7d94947609ae654c61fcdf8 /core/vm/context.go | |
parent | 7e58949c3f4c67960fb0422f49f3e513a388cc5d (diff) | |
download | go-tangerine-468501cb860508af55e1fcd586e1498df0a2d984.tar go-tangerine-468501cb860508af55e1fcd586e1498df0a2d984.tar.gz go-tangerine-468501cb860508af55e1fcd586e1498df0a2d984.tar.bz2 go-tangerine-468501cb860508af55e1fcd586e1498df0a2d984.tar.lz go-tangerine-468501cb860508af55e1fcd586e1498df0a2d984.tar.xz go-tangerine-468501cb860508af55e1fcd586e1498df0a2d984.tar.zst go-tangerine-468501cb860508af55e1fcd586e1498df0a2d984.zip |
core/vm: changed program counter to uint64
Diffstat (limited to 'core/vm/context.go')
-rw-r--r-- | core/vm/context.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/vm/context.go b/core/vm/context.go index de03f84f0..e33324b53 100644 --- a/core/vm/context.go +++ b/core/vm/context.go @@ -49,13 +49,13 @@ func NewContext(caller ContextRef, object ContextRef, value, gas, price *big.Int return c } -func (c *Context) GetOp(n *big.Int) OpCode { +func (c *Context) GetOp(n uint64) OpCode { return OpCode(c.GetByte(n)) } -func (c *Context) GetByte(n *big.Int) byte { - if n.Cmp(big.NewInt(int64(len(c.Code)))) < 0 { - return c.Code[n.Int64()] +func (c *Context) GetByte(n uint64) byte { + if n < uint64(len(c.Code)) { + return c.Code[n] } return 0 |