mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +00:00
revert push1 change
This commit is contained in:
parent
06ba0c9e1a
commit
fc8c27a5ca
1 changed files with 9 additions and 5 deletions
|
|
@ -875,12 +875,13 @@ func makeLog(size int) executionFunc {
|
||||||
func opPush1(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byte, error) {
|
func opPush1(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byte, error) {
|
||||||
var (
|
var (
|
||||||
codeLen = uint64(len(scope.Contract.Code))
|
codeLen = uint64(len(scope.Contract.Code))
|
||||||
|
integer = new(uint256.Int)
|
||||||
)
|
)
|
||||||
*pc += 1
|
*pc += 1
|
||||||
if *pc < codeLen {
|
if *pc < codeLen {
|
||||||
scope.Stack.push(new(uint256.Int).SetUint64(uint64(scope.Contract.Code[*pc])))
|
scope.Stack.push(integer.SetUint64(uint64(scope.Contract.Code[*pc])))
|
||||||
} else {
|
} else {
|
||||||
scope.Stack.push(new(uint256.Int).Clear())
|
scope.Stack.push(integer.Clear())
|
||||||
}
|
}
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
@ -888,9 +889,12 @@ func opPush1(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]by
|
||||||
// make push instruction function
|
// make push instruction function
|
||||||
func makePush(size uint64, pushByteSize int) executionFunc {
|
func makePush(size uint64, pushByteSize int) executionFunc {
|
||||||
return func(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byte, error) {
|
return func(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byte, error) {
|
||||||
codeLen := len(scope.Contract.Code)
|
var (
|
||||||
startMin := min(codeLen, int(*pc+1))
|
codeLen = len(scope.Contract.Code)
|
||||||
endMin := min(startMin+pushByteSize, codeLen)
|
startMin = min(codeLen, int(*pc+1))
|
||||||
|
endMin = min(startMin+pushByteSize, codeLen)
|
||||||
|
)
|
||||||
|
|
||||||
scope.Stack.push(new(uint256.Int).SetBytes(
|
scope.Stack.push(new(uint256.Int).SetBytes(
|
||||||
common.RightPadBytes(
|
common.RightPadBytes(
|
||||||
scope.Contract.Code[startMin:endMin],
|
scope.Contract.Code[startMin:endMin],
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue