Skip to content

Commit

Permalink
core/vm: add de-activation of opCallExpert comment (#340)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronbuchwald authored Sep 21, 2023
1 parent 4b1944b commit 43d6117
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/vm/instructions.go
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,7 @@ func opCall(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byt
return ret, nil
}

// Note: opCallExpert was de-activated in ApricotPhase2.
func opCallExpert(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byte, error) {
stack := scope.Stack
// Pop gas. The actual gas in interpreter.evm.callGasTemp.
Expand All @@ -730,6 +731,8 @@ func opCallExpert(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext)
// Get the arguments from the memory.
args := scope.Memory.GetPtr(int64(inOffset.Uint64()), int64(inSize.Uint64()))

// Note: this code fails to check that value2 is zero, which was a bug when CALLEX was active.
// The CALLEX opcode was de-activated in ApricotPhase2 resolving this issue.
if interpreter.readOnly && !value.IsZero() {
return nil, vmerrs.ErrWriteProtection
}
Expand Down

0 comments on commit 43d6117

Please sign in to comment.