diff --git a/Godeps/_workspace/src/github.com/tendermint/tendermint/vm/vm.go b/Godeps/_workspace/src/github.com/tendermint/tendermint/vm/vm.go index 99b354f6a2c00a6fd5da25a57ce33c43ce36dff1..180b84f44eedac6f02d916cdc41e988d361fbbe4 100644 --- a/Godeps/_workspace/src/github.com/tendermint/tendermint/vm/vm.go +++ b/Godeps/_workspace/src/github.com/tendermint/tendermint/vm/vm.go @@ -776,7 +776,16 @@ func (vm *VM) call(caller, callee *Account, code, input []byte, value int64, gas return nil, ErrPermission{"call"} } gasLimit := stack.Pop64() - addr, value := stack.Pop(), stack.Pop64() + addr := stack.Pop() + // NOTE: for DELEGATECALL value is preserved from the original + // caller, as such it is not stored on stack for the address + // to be called; for CALL and CALLCODE value is stored on stack + // and needs to be overwritten from the given value. + // TODO: [ben] assert that malicious code cannot produce + // new value. + if op != DELEGATECALL { + value = stack.Pop64() + } inOffset, inSize := stack.Pop64(), stack.Pop64() // inputs retOffset, retSize := stack.Pop64(), stack.Pop64() // outputs dbg.Printf(" => %X\n", addr)