core/vm: changed program counter to uint64

This commit is contained in:
obscuren
2015-06-10 10:44:46 +02:00
parent 7e58949c3f
commit 468501cb86
2 changed files with 13 additions and 13 deletions

View File

@ -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