aboutsummaryrefslogtreecommitdiffstats
path: root/vm/vm.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-19 21:31:41 +0800
committerobscuren <geffobscura@gmail.com>2015-03-19 21:31:41 +0800
commitd4e5747d040f290eb3697ded891619887a8593da (patch)
tree4df57f053b3a4dd7b7dde4fde3d4ddeafd14f98e /vm/vm.go
parente13c6739804604849c7e43d27b073e68fba58191 (diff)
parentcf45b939a098c9421092226d5c76dbce34eb2dda (diff)
downloadgo-tangerine-d4e5747d040f290eb3697ded891619887a8593da.tar
go-tangerine-d4e5747d040f290eb3697ded891619887a8593da.tar.gz
go-tangerine-d4e5747d040f290eb3697ded891619887a8593da.tar.bz2
go-tangerine-d4e5747d040f290eb3697ded891619887a8593da.tar.lz
go-tangerine-d4e5747d040f290eb3697ded891619887a8593da.tar.xz
go-tangerine-d4e5747d040f290eb3697ded891619887a8593da.tar.zst
go-tangerine-d4e5747d040f290eb3697ded891619887a8593da.zip
Merge branch 'develop' into conversion
Diffstat (limited to 'vm/vm.go')
-rw-r--r--vm/vm.go17
1 files changed, 4 insertions, 13 deletions
diff --git a/vm/vm.go b/vm/vm.go
index 49e8cca98..3bfaef271 100644
--- a/vm/vm.go
+++ b/vm/vm.go
@@ -441,24 +441,15 @@ func (self *Vm) Run(context *Context, callData []byte) (ret []byte, err error) {
self.Printf(" => %d", l)
case CALLDATACOPY:
var (
- size = uint64(len(callData))
mOff = stack.pop().Uint64()
cOff = stack.pop().Uint64()
l = stack.pop().Uint64()
)
+ data := getData(callData, cOff, l)
- if cOff > size {
- cOff = 0
- l = 0
- } else if cOff+l > size {
- l = 0
- }
-
- code := callData[cOff : cOff+l]
-
- mem.Set(mOff, l, code)
+ mem.Set(mOff, l, data)
- self.Printf(" => [%v, %v, %v] %x", mOff, cOff, l, callData[cOff:cOff+l])
+ self.Printf(" => [%v, %v, %v] %x", mOff, cOff, l, data)
case CODESIZE, EXTCODESIZE:
var code []byte
if op == EXTCODESIZE {
@@ -486,7 +477,7 @@ func (self *Vm) Run(context *Context, callData []byte) (ret []byte, err error) {
cOff = stack.pop().Uint64()
l = stack.pop().Uint64()
)
- codeCopy := getCode(code, cOff, l)
+ codeCopy := getData(code, cOff, l)
mem.Set(mOff, l, codeCopy)