vm: fix errors not being returned

This commit is contained in:
Ethan Buchman
2015-04-02 19:14:58 -07:00
parent 3bedcbf94d
commit ade13daec1
2 changed files with 4 additions and 4 deletions

View File

@ -659,7 +659,7 @@ func (vm *VM) call(caller, callee *Account, code, input []byte, value uint64, ga
case RETURN: // 0xF3
offset, size := stack.Pop64(), stack.Pop64()
ret, ok := subslice(memory, offset, size, false)
if !ok {
if !ok || err != nil {
return nil, firstErr(err, ErrMemoryOutOfBounds)
}
dbg.Printf(" => [%v, %v] (%d) 0x%X\n", offset, size, len(ret), ret)