aboutsummaryrefslogtreecommitdiffstats
path: root/vm
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-01-04 21:20:16 +0800
committerobscuren <geffobscura@gmail.com>2015-01-04 21:20:16 +0800
commit09841b1c9b2553a4572590128580df37c8fa83ad (patch)
tree42a846801bde7d8f7edc5ec07ccbba7806261128 /vm
parentbd0c267cbe9db805b5a272d29ef8860c62ddafe5 (diff)
downloadgo-tangerine-09841b1c9b2553a4572590128580df37c8fa83ad.tar
go-tangerine-09841b1c9b2553a4572590128580df37c8fa83ad.tar.gz
go-tangerine-09841b1c9b2553a4572590128580df37c8fa83ad.tar.bz2
go-tangerine-09841b1c9b2553a4572590128580df37c8fa83ad.tar.lz
go-tangerine-09841b1c9b2553a4572590128580df37c8fa83ad.tar.xz
go-tangerine-09841b1c9b2553a4572590128580df37c8fa83ad.tar.zst
go-tangerine-09841b1c9b2553a4572590128580df37c8fa83ad.zip
Cleaned up some of that util
Diffstat (limited to 'vm')
-rw-r--r--vm/context.go10
-rw-r--r--vm/vm_debug.go2
2 files changed, 6 insertions, 6 deletions
diff --git a/vm/context.go b/vm/context.go
index d995c92c7..d14df1aa7 100644
--- a/vm/context.go
+++ b/vm/context.go
@@ -38,13 +38,13 @@ func NewContext(caller ContextRef, object ContextRef, code []byte, gas, price *b
return c
}
-func (c *Context) GetOp(x uint64) OpCode {
- return OpCode(c.GetByte(x))
+func (c *Context) GetOp(n uint64) OpCode {
+ return OpCode(c.GetByte(n))
}
-func (c *Context) GetByte(x uint64) byte {
- if x < uint64(len(c.Code)) {
- return c.Code[x]
+func (c *Context) GetByte(n uint64) byte {
+ if n < uint64(len(c.Code)) {
+ return c.Code[n]
}
return 0
diff --git a/vm/vm_debug.go b/vm/vm_debug.go
index acad9c5e7..92e4154e4 100644
--- a/vm/vm_debug.go
+++ b/vm/vm_debug.go
@@ -83,7 +83,7 @@ func (self *DebugVm) Run(me, caller ContextRef, code []byte, value, gas, price *
jump = func(from uint64, to *big.Int) {
p := to.Uint64()
- nop := OpCode(context.GetOp(p))
+ nop := context.GetOp(p)
if !destinations.Has(p) {
panic(fmt.Sprintf("invalid jump destination (%v) %v", nop, p))
}