Commit a756dbeb authored by obscuren's avatar obscuren

Removed uint casts

parent cf45b939
...@@ -443,13 +443,16 @@ func (self *Vm) Run(context *Context, callData []byte) (ret []byte, err error) { ...@@ -443,13 +443,16 @@ func (self *Vm) Run(context *Context, callData []byte) (ret []byte, err error) {
self.Printf(" => %d", l) self.Printf(" => %d", l)
case CALLDATACOPY: case CALLDATACOPY:
var ( var (
mOff = stack.pop().Uint64() mOff = stack.pop()
cOff = stack.pop().Uint64() cOff = stack.pop()
l = stack.pop().Uint64() l = stack.pop()
) )
data := getData(callData, cOff, l) var data []byte
if cOff.Cmp(big.NewInt(int64(len(callData)))) <= 0 {
data = getData(callData, cOff.Uint64(), l.Uint64())
}
mem.Set(mOff, l, data) mem.Set(mOff.Uint64(), l.Uint64(), data)
self.Printf(" => [%v, %v, %v] %x", mOff, cOff, l, data) self.Printf(" => [%v, %v, %v] %x", mOff, cOff, l, data)
case CODESIZE, EXTCODESIZE: case CODESIZE, EXTCODESIZE:
...@@ -473,14 +476,19 @@ func (self *Vm) Run(context *Context, callData []byte) (ret []byte, err error) { ...@@ -473,14 +476,19 @@ func (self *Vm) Run(context *Context, callData []byte) (ret []byte, err error) {
} else { } else {
code = context.Code code = context.Code
} }
var ( var (
mOff = stack.pop().Uint64() mOff = stack.pop()
cOff = stack.pop().Uint64() cOff = stack.pop()
l = stack.pop().Uint64() l = stack.pop()
) )
codeCopy := getData(code, cOff, l)
mem.Set(mOff, l, codeCopy) var codeCopy []byte
if cOff.Cmp(big.NewInt(int64(len(code)))) <= 0 {
codeCopy = getData(code, cOff.Uint64(), l.Uint64())
}
mem.Set(mOff.Uint64(), l.Uint64(), codeCopy)
self.Printf(" => [%v, %v, %v] %x", mOff, cOff, l, codeCopy) self.Printf(" => [%v, %v, %v] %x", mOff, cOff, l, codeCopy)
case GASPRICE: case GASPRICE:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment