From 5028d55fad62b152f18a626dfb6195da61909d4b Mon Sep 17 00:00:00 2001 From: lmittmann Date: Fri, 11 Apr 2025 16:02:13 +0200 Subject: [PATCH] simplified --- core/vm/instructions.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/core/vm/instructions.go b/core/vm/instructions.go index 0b3b1d1569..5a93479f7c 100644 --- a/core/vm/instructions.go +++ b/core/vm/instructions.go @@ -964,10 +964,9 @@ func opPush1(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]by ) *pc += 1 if *pc < codeLen { - scope.Stack.push(integer.SetUint64(uint64(scope.Contract.Code[*pc]))) - } else { - scope.Stack.push(integer.Clear()) + integer.SetUint64(uint64(scope.Contract.Code[*pc])) } + scope.Stack.push(integer) return nil, nil } @@ -978,12 +977,11 @@ func opPush2(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]by integer = new(uint256.Int) ) if *pc+2 < codeLen { - scope.Stack.push(integer.SetBytes2(scope.Contract.Code[*pc+1 : *pc+3])) + integer.SetBytes2(scope.Contract.Code[*pc+1 : *pc+3]) } else if *pc+1 < codeLen { - scope.Stack.push(integer.SetUint64(uint64(scope.Contract.Code[*pc+1]) << 8)) - } else { - scope.Stack.push(integer.Clear()) + integer.SetUint64(uint64(scope.Contract.Code[*pc+1]) << 8) } + scope.Stack.push(integer) *pc += 2 return nil, nil }