Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
ucwong committed Sep 6, 2021
1 parent 75cd47f commit cb78eb6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions core/vm/instructions.go
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,6 @@ func opCall(pc *uint64, interpreter *CVMInterpreter, callContext *callCtx) ([]by
}
stack.push(&temp)
if err == nil || err == ErrExecutionReverted {
ret = common.CopyBytes(ret)
callContext.memory.Set(retOffset.Uint64(), retSize.Uint64(), ret)
}
callContext.contract.Gas += returnGas
Expand Down Expand Up @@ -907,7 +906,6 @@ func opCallCode(pc *uint64, interpreter *CVMInterpreter, callContext *callCtx) (
}
stack.push(&temp)
if err == nil || err == ErrExecutionReverted {
ret = common.CopyBytes(ret)
callContext.memory.Set(retOffset.Uint64(), retSize.Uint64(), ret)
}
callContext.contract.Gas += returnGas
Expand Down Expand Up @@ -937,7 +935,6 @@ func opDelegateCall(pc *uint64, interpreter *CVMInterpreter, callContext *callCt
}
stack.push(&temp)
if err == nil || err == ErrExecutionReverted {
ret = common.CopyBytes(ret)
callContext.memory.Set(retOffset.Uint64(), retSize.Uint64(), ret)
}
callContext.contract.Gas += returnGas
Expand Down Expand Up @@ -967,7 +964,6 @@ func opStaticCall(pc *uint64, interpreter *CVMInterpreter, callContext *callCtx)
}
stack.push(&temp)
if err == nil || err == ErrExecutionReverted {
ret = common.CopyBytes(ret)
callContext.memory.Set(retOffset.Uint64(), retSize.Uint64(), ret)
}
callContext.contract.Gas += returnGas
Expand Down
2 changes: 1 addition & 1 deletion core/vm/interpreter.go
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ func (in *CVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) (
// if the operation clears the return data (e.g. it has returning data)
// set the last return to the result of the operation.
if operation.returns {
in.returnData = res
in.returnData = common.CopyBytes(res)
}
switch {
case err != nil:
Expand Down

0 comments on commit cb78eb6

Please sign in to comment.