mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +00:00
Update instructions.go
This commit is contained in:
parent
fc8c27a5ca
commit
5b48bdd72b
1 changed files with 3 additions and 5 deletions
|
|
@ -891,17 +891,15 @@ 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) {
|
||||||
var (
|
var (
|
||||||
codeLen = len(scope.Contract.Code)
|
codeLen = len(scope.Contract.Code)
|
||||||
startMin = min(codeLen, int(*pc+1))
|
start = min(codeLen, int(*pc+1))
|
||||||
endMin = min(startMin+pushByteSize, codeLen)
|
end = min(start+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[start:end],
|
||||||
pushByteSize,
|
pushByteSize,
|
||||||
)),
|
)),
|
||||||
)
|
)
|
||||||
|
|
||||||
*pc += size
|
*pc += size
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue