aboutsummaryrefslogtreecommitdiffstats
path: root/vm
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-12-10 18:27:10 +0800
committerobscuren <geffobscura@gmail.com>2014-12-10 18:27:10 +0800
commit186948da22feeca138ffb976fbf96033045ad350 (patch)
tree29b66414022ba03c5c87a85cf523f1fd58c9b7a8 /vm
parent4f1ef89cb21345f3273417ec989164670e880dee (diff)
downloadgo-tangerine-186948da22feeca138ffb976fbf96033045ad350.tar
go-tangerine-186948da22feeca138ffb976fbf96033045ad350.tar.gz
go-tangerine-186948da22feeca138ffb976fbf96033045ad350.tar.bz2
go-tangerine-186948da22feeca138ffb976fbf96033045ad350.tar.lz
go-tangerine-186948da22feeca138ffb976fbf96033045ad350.tar.xz
go-tangerine-186948da22feeca138ffb976fbf96033045ad350.tar.zst
go-tangerine-186948da22feeca138ffb976fbf96033045ad350.zip
changed to unsigned integers
Diffstat (limited to 'vm')
-rw-r--r--vm/stack.go4
-rw-r--r--vm/vm_debug.go22
2 files changed, 13 insertions, 13 deletions
diff --git a/vm/stack.go b/vm/stack.go
index 98795cc03..6091479cb 100644
--- a/vm/stack.go
+++ b/vm/stack.go
@@ -111,10 +111,10 @@ func NewMemory() *Memory {
return &Memory{nil}
}
-func (m *Memory) Set(offset, size int64, value []byte) {
+func (m *Memory) Set(offset, size uint64, value []byte) {
if len(value) > 0 {
totSize := offset + size
- lenSize := int64(len(m.store) - 1)
+ lenSize := uint64(len(m.store) - 1)
if totSize > lenSize {
// Calculate the diff between the sizes
diff := totSize - lenSize
diff --git a/vm/vm_debug.go b/vm/vm_debug.go
index c0a2d6d98..5b7258cc5 100644
--- a/vm/vm_debug.go
+++ b/vm/vm_debug.go
@@ -98,7 +98,7 @@ func (self *DebugVm) Run(me, caller ClosureRef, code []byte, value, gas, price *
} else {
nop := OpCode(closure.GetOp(p))
if !(nop == JUMPDEST || destinations[from] != nil) {
- panic(fmt.Sprintf("JUMP missed JUMPDEST (%v) %v", nop, p))
+ panic(fmt.Sprintf("invalid jump destination (%v) %v", nop, p))
} else if nop == JUMP || nop == JUMPI {
panic(fmt.Sprintf("not allowed to JUMP(I) in to JUMP"))
}
@@ -611,10 +611,10 @@ func (self *DebugVm) Run(me, caller ClosureRef, code []byte, value, gas, price *
self.Printf(" => %d", l)
case CALLDATACOPY:
var (
- size = int64(len(callData))
- mOff = stack.Pop().Int64()
- cOff = stack.Pop().Int64()
- l = stack.Pop().Int64()
+ size = uint64(len(callData))
+ mOff = stack.Pop().Uint64()
+ cOff = stack.Pop().Uint64()
+ l = stack.Pop().Uint64()
)
if cOff > size {
@@ -654,10 +654,10 @@ func (self *DebugVm) Run(me, caller ClosureRef, code []byte, value, gas, price *
}
var (
- size = int64(len(code))
- mOff = stack.Pop().Int64()
- cOff = stack.Pop().Int64()
- l = stack.Pop().Int64()
+ size = uint64(len(code))
+ mOff = stack.Pop().Uint64()
+ cOff = stack.Pop().Uint64()
+ l = stack.Pop().Uint64()
)
if cOff > size {
@@ -760,7 +760,7 @@ func (self *DebugVm) Run(me, caller ClosureRef, code []byte, value, gas, price *
case MSTORE: // Store the value at stack top-1 in to memory at location stack top
// Pop value of the stack
val, mStart := stack.Popn()
- mem.Set(mStart.Int64(), 32, ethutil.BigToBytes(val, 256))
+ mem.Set(mStart.Uint64(), 32, ethutil.BigToBytes(val, 256))
self.Printf(" => 0x%x", val)
case MSTORE8:
@@ -883,7 +883,7 @@ func (self *DebugVm) Run(me, caller ClosureRef, code []byte, value, gas, price *
stack.Push(ethutil.BigTrue)
msg.Output = ret
- mem.Set(retOffset.Int64(), retSize.Int64(), ret)
+ mem.Set(retOffset.Uint64(), retSize.Uint64(), ret)
}
self.Printf("resume %x", closure.Address())