diff --git a/core/vm/eips.go b/core/vm/eips.go index 197b64dac5..a69946de4d 100644 --- a/core/vm/eips.go +++ b/core/vm/eips.go @@ -294,10 +294,10 @@ func opBlobBaseFee(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) return nil, nil } +// opCLZ implements the CLZ opcode (count leading zero bytes) func opCLZ(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byte, error) { - x := scope.Stack.pop() - // count leading zero bits in x - scope.Stack.push(new(uint256.Int).SetUint64(256 - uint64(x.BitLen()))) + x := scope.Stack.peek() + x.SetUint64(256 - uint64(x.BitLen())) return nil, nil }